-(defmethod initialize-instance ((widget widget) &rest initargs &key parent)
- (declare (ignore initargs))
- (cond
- ((consp parent)
- (with-slots ((container parent) child-slots) widget
- (setf
- container (car parent)
- child-slots
- (apply
- #'make-instance
- (slot-value (class-of container) 'child-class)
- :parent container :child widget (cdr parent)))))
- (parent
- (setf (slot-value widget 'parent) parent)))
- (call-next-method))
-
-
-(defmethod slot-unbound ((class object-class) (object widget) slot)
+(defmethod shared-initialize ((widget widget) names &rest initargs &key parent)
+ (remf initargs :parent)
+ (prog1
+ (apply #'call-next-method widget names initargs)
+ (when parent
+ (when (slot-boundp widget 'parent)
+ (container-remove (widget-parent widget) widget))
+ (let ((parent-widget (first (mklist parent)))
+ (args (rest (mklist parent))))
+ (apply #'container-add parent-widget widget args)))))
+
+(defmethod shared-initialize :after ((widget widget) names &rest initargs
+ &key show-all all-visible)
+ (declare (ignore initargs names))
+ (when (or all-visible show-all)
+ (widget-show-all widget)))
+
+
+(defmethod slot-unbound ((class gobject-class) (object widget) slot)