Re: [gtk-list] Re: Destroying windows & widgets -- anybody?



Havoc Pennington <rhpennin@midway.uchicago.edu> writes:

> It is different in Gtk+ and Gtk--. In Gtk+, calling gtk_widget_destroy on
> a parent widget will destroy that widget and all its children (well,
> usually - underneath it actually does refcounting and occasionally this
> will matter). 

Nitpick, but I actually think it's important: gtk_widget_destroy will
allways "destroy" right away.  The refcounting stuff might delay the
"finalization" of a widget but not its destruction.

"Destroy" in the context of Gtk means: destroy the XWindow, remove the
widget from its parent and destroy all child widgets.  "Finalize"
means basically: free the memory of the widget struct and all other
system resources like the memory for a char* label.

This is done so that you can "destroy" a widget reliably at any time
you want but keep the struct around until no pointers to it exist.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]