Tristan Van Berkom <[EMAIL PROTECTED]> writes: > Annamalai Gurusami wrote: >> Hello All, >> In my GTK+ application, I am having a GtkNotebook. I am adding one >> page, with a GtkScrolledWindow as a child, and a GtkHBox as a label. >> I remove this page from GtkNotebook. My question is when I remove >> this page from GtkNotebook, are the child widgets destroyed? > > If you dont have an explicit reference to the widget in the page > (i.e. the page) then the widget and its children are destroyed.
Is this some kind of garbage collection technique that GTK uses? Can you comment w.r.t the code snippet here? Especially, is the second call to 'gtk_notebook_append_page' valid? I see that the widgets 'scroll' and 'hbox' can be considered as explicit reference to the widgets in the notebook page that I am adding. GtkWidget* notebook = gtk_notebook_new(); GtkWidget* scroll = gtk_scrolled_window_new(NULL, NULL); GtkWidget* hbox = gtk_hbox_new(FALSE, 0); gint idx = gtk_notebook_append_page ( GTK_NOTEBOOK(notebook), scroll, hbox); gtk_notebook_remove_page( GTK_NOTEBOOK(notebook), idx); // After the above sequence of operations, is the below line // valid. Are 'scroll' and 'hbox' still valid? Or are they // destroyed by 'gtk_notebook_remove_page'? gint idx = gtk_notebook_append_page ( GTK_NOTEBOOK(notebook), scroll, hbox); > See: > http://developer.gnome.org/doc/API/2.0/gtk/GtkObject.html > (desctiption section) for an interesting discussion on > reference counting in GTK+. > Oops. Maybe I should have replied after reading the above URL. Thanks for pointing it out. I'll be reading it now. Thank you for your time. Rgds, anna -- Open Movie: Not only will the project be realized with Open Source/Free Software, but also the resulting movie will be published under an open public license. This makes it an exciting premiere as first ever "Open Movie" project! [ http://orange.blender.org ] _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list