Re: Widget destruction required?



fielder cs ttu edu wrote:
Should all widgets created be manually destroyed?
The gtk_widget_destroy() and friends references do
not go into much detail on it.

When you destroy a widget, all its descendants (i.e. everything
packed into it) is destroyed too, unless you keep an extra
reference (with g_object_ref()).  So, if you need to destroy
anything at all, this will be top-level windows in most cases.

GTK+ destroys windows upon receiving `delete-event' by default.
I.e. if you don't block that behaviour, whenever a user closes
your window, it is destroyed automatically.

One typical situation where you need to call gtk_widget_destroy()
yourself is in callback to `response' signal of dialogs.

Paul



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