window.stk 2.46 KB
Newer Older
eg's avatar
eg committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
;;;;
;;;; window.stk	-- GTK Windows
;;;; 
;;;; Copyright  2001 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; 
;;;; 
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;; 
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;;; GNU General Public License for more details.
;;;; 
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
;;;; USA.
;;;; 
;;;;           Author: Erick Gallesio [eg@unice.fr]
;;;;    Creation date: 25-May-2001 15:47 (eg)
;;;; Last file update:  3-Aug-2001 09:07 (eg)
;;;;

;======================================================================
;
;			C l a s s   < w i n d o w >
;
;====================================================================== 

(define-class <window> (<gtk-layout>)
  ((title	 :accessor	title
		 :init-keyword	:title
		 :allocation	:gtk-arg)
  (resizeable?	 :accessor	resizeable
		 :init-keyword  :resizeable
		 :allocation	:gtk-arg
		 :gtk-name	"allow_grow")
   (transient	 :accessor	transient
		 :init-keyword	:transient
		 :init-form	#f)
   (x		 :accessor	x-pos
		 :init-keyword	:x
		 :allocation	:gtk-arg)
   (y		 :accessor 	y-pos
		 :init-keyword	:y
		 :allocation	:gtk-arg)
   (modal	 :accessor 	modal
		 :init-keyword	:modal
		 :allocation	:gtk-arg)
   (position	 :accessor	position
		 :init-keyword	:position
		 :gtk-name	"window_position"
		 :allocation	:gtk-arg)))


(define-method realize-widget ((self <window>) initargs)
  (next-method)
  (let ((transient (key-get initargs :transient #f)))
    (slot-set! self 'wid ( (if transient %transient %toplevel) self))
    ;; Make the window the good size (if user has not specified an explicit one)
    (%gtk-arg-set! (slot-ref self 'wid) :auto_shrink #t)))

;//;;
;//;; CONTAINER-ADD!
;//;;
;//(define-method container-add! ((cont <window>) (widget <gtk-widget>) . options)
;//  (let ((layout (slot-ref cont 'layout)))
;//    (if (is-a? layout <gtk-object>)
;//	(apply container-add! layout widget options)
;//	(%set-widget-parent! (slot-ref widget 'wid) (slot-ref cont 'wid)))))