John Margaglione wrote:
>
> In the generated source for glade apps, there are a myriad calls to
> gtk_widget_ref/unref. I have never seen such proliferant usage of the
> ref/unref mechanism. Doesn't gtk+ automatically destroy widgets when
> the application closes using gtk_main_quit? Is all this ref'fing really
> necessary?
It is used since we store pointers to all widgets in the datalist of the
toplevel widget, by calling gtk_object_set_data_full(). These pointers
are used for the lookup_widget() utility function Glade provides.
If we didn't use the ref/unref, and a widget in the interface was
removed, then using lookup_widget() would return an invalid memory
address and the app would probably crash.
Though to be honest I'm not sure it is that useful. People rarely
remove widgets, and if they do they should know not to call lookup_widget()
for it.
Damon
_______________________________________________
Glade-devel maillist - [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/glade-devel