Does GtkBuilder destroy all generated widgets?

Question about GtkBuilder. When we create the unref builder pointer, does it destroy all screens / widgets created by the creator?

if( builder_ptr )
    g_object_unref(G_OBJECT(builder_ptr));

      

Suppose we created one screen using Glade / XML with some 2-3 top chapters in it

gtk_builder_add_from_file(builder_ptr, "Test.glade", &error )

      

and the generated GtkBuilder pointer (as above), so after deleting this pointer, it deletes the windows created or do we need to manually delete those windows?

Thanks
PP.

+2


source to share


1 answer


From the documentation :

A GtkBuilder contains a reference to all the objects it has built and throws those references when it is finished. This refinement can lead to the destruction of objects without a widget or widgets that are not contained in the top-level window. For top windows built by the builder, it is the responsibility of calling gtk_widget_destroy () to get rid of them and all the widgets they contain.



So, no, GtkBuilder doesn't do this for you, you have to do it yourself.

+3


source







All Articles