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

Re: Widget management



>  I'm wondering how widgets are actually managed by GTK.

Very carefully ;-)

>  If I call gtk_widget_destroy(wdg), are all the sub-widgets
>  attached to wdg destroyed too? (If so what if I attach a
>  widget to two others?)

All child widgets are automatically destroyed when you destroy the
parent.  A widget can have at most one parent.

>  I don't quite understand ref and unref. Is there a kind
>  of garbage-collection in the gtk_main loop?

No, it is just simple reference counting.  Take a look at the
gtk+/docs/refcounting.txt document for the gritty details.

>  I'd like to know how this all works (basically)
>  cos I've got no idea if my widgets are all correctly
>  destroyed or if there are 'ghost widgets haunting around'

If you are doing exotic things like unparenting widgets and such, you
may want to use the --gtk-debug=objects option to see if you are
leaking objects somewhere.  Generally, though, you are safe if you
destroy all your toplevels.

  Federico



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