-(defclass container (widget)
- ((border-width
- :allocation :arg
- :accessor container-border-width
- :initarg :border-width
- :type unsigned-long)
- (resize-mode
- :allocation :arg
- :accessor container-resize-mode
- :initarg :resize-mode
- :type resize-mode)
- (children
- :allocation :virtual
- :location container-children
-; :initarg :children
- )
- (focus-child
- :allocation :virtual
- :location ("gtk_container_get_focus_child" "gtk_container_set_focus_child")
- :accessor container-focus-child
- :initarg :focus-child
- :type widget)
- (focus-hadjustment
- :allocation :virtual
- :location (nil "gtk_container_set_focus_hadjustment")
- :writer (setf container-focus-hadjustment)
- :initarg :focus-hadjustment
- :type adjustment)
- (focus-vadjustment
- :allocation :virtual
- :location (nil "gtk_container_set_focus_vadjustment")
- :writer (setf container-focus-vadjustment)
- :initarg :focus-vadjustment
- :type adjustment))
- (:metaclass widget-class)
- (:alien-name "GtkContainer"))
-
-
-(defmethod initialize-instance ((container container) &rest initargs
- &key children)
- (declare (ignore initargs))
+(defgeneric container-add (container widget &rest args))
+(defgeneric container-remove (container widget))
+(defgeneric container-all-children (container))
+(defgeneric container-internal-children (container))
+(defgeneric (setf container-children) (children container))
+
+
+(defun initial-add (object function initargs key pkey)
+ (loop
+ as (initarg value . rest) = initargs then rest
+ do (cond
+ ((eq initarg key) (funcall function object value))
+ ((eq initarg pkey) (mapc #'(lambda (value)
+ (funcall function object value))
+ value)))
+ while rest))
+
+(defun initial-apply-add (object function initargs key pkey)
+ (initial-add object #'(lambda (object value)
+ (apply function object (mklist value)))
+ initargs key pkey))
+
+
+(defmethod shared-initialize ((container container) names &rest initargs
+ &key child children child-args
+ (show-children nil show-children-p))
+ (declare (ignore names child children))
+ (when show-children-p
+ (if (not show-children)
+ (setf (user-data container 'show-recursive-p) nil)
+ (signal-connect container 'show #'container-show-recursive
+ :object t :remove t)))
+