Re: does destroy() destroy child widgets?

From: Date: Fri, 28 Mar 2003 03:57:05 +0000
Subject: Re: does destroy() destroy child widgets?
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3165@lists.php.net to get a copy of this message
yeah, it propogates.. Basically when an object's reference becomes 0 it is destroyed automatically (in GTK+). If a parent widget is destroyed, the child's reference, which relied on the parent's parenting it, also becomes 0. I'm surprised you're not getting weird results by showing the child before you create the parent.. ----- Original Message ----- From: "Benjamin Smith" <bens@effortlessis.com> To: "php-gtk-general" <php-gtk-general@lists.php.net> Sent: Friday, March 28, 2003 3:43 AM Subject: [PHP-GTK] does destroy() destroy child widgets? > Does destroy() for a container widget destroy the child widgets? > > EG: in the below example, does the widget referenced by $label get destroyed, > or just hidden from view because its parent is destroyed? > > If it gets destroyed, does this also apply fully recursively? ($GtkLabel > inside $GtkVBox inside $GtkFixed inside $GtkFrame inside $GtkWindow, and > $GtkWindow->destroy is called, to destroy them all) > > I can't seem to find this in the manual. (though it may be right in front of > me...) > ----------------------------------------------- > $label=&New GtkLabel('Hello world!'); > $label->Show(); > > $bg=&New GtkFixed(); > $bg->Set_Usize(200, 65); > $bg->Put($label, 5, 5); > $bg->Show(); > > // a bunch of other stuff executed > > $bg->Destroy(); > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.gtk.general (#3165) next »