chiark / gitweb /
Changes in widget initialization
authorespen <espen>
Tue, 20 Nov 2001 18:25:53 +0000 (18:25 +0000)
committerespen <espen>
Tue, 20 Nov 2001 18:25:53 +0000 (18:25 +0000)
gtk/gtkcontainer.lisp
gtk/gtkwidget.lisp

index 10ab53855e946a37147a784d2b6482d30b9c4284..073dd3631fe8d55216fabf7d49c8679e48ea4dcd 100644 (file)
 ;; License along with this library; if not, write to the Free Software
 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-;; $Id: gtkcontainer.lisp,v 1.5 2001-10-25 08:16:17 espen Exp $
+;; $Id: gtkcontainer.lisp,v 1.6 2001-11-20 18:25:53 espen Exp $
 
 (in-package "GTK")
-
-(defmethod initialize-instance ((container container) &rest initargs)
+            
+(defmethod shared-initialize ((container container) names &rest initargs)
   (call-next-method)
   (dolist (child (get-all initargs :child))
     (apply #'container-add container (mklist child))))
index d9bdc1a8fb96dc8616bc9a88ac7f891a5a0b80dd..920fae10ab070342bc22abc3d4bc67a8043430ec 100644 (file)
 ;; License along with this library; if not, write to the Free Software
 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-;; $Id: gtkwidget.lisp,v 1.5 2001-10-21 23:22:04 espen Exp $
+;; $Id: gtkwidget.lisp,v 1.6 2001-11-20 18:25:53 espen Exp $
 
 (in-package "GTK")
 
 
-(defmethod initialize-instance ((widget widget) &rest initargs &key parent)
-  (declare (ignore initargs))
+(defmethod shared-initialize ((widget widget) names &rest initargs &key parent)
+  (declare (ignore initargs names))
   (call-next-method)
   (when parent
-    (let ((parent-widget (first (mklist parent)))
+    (let ((old-parent (widget-parent widget))
+         (parent-widget (first (mklist parent)))
          (args (rest (mklist parent))))
+      (when old-parent
+       (container-remove old-parent widget))
       (apply #'container-add parent-widget widget args))))
 
-(defmethod initialize-instance :after ((widget widget) &rest initargs
-                                      &key show-all)
-  (declare (ignore initargs))
+(defmethod shared-initialize :after ((widget widget) names &rest initargs
+                                    &key show-all)
+  (declare (ignore initargs names))
   (when show-all
     (widget-show-all widget)))