diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index d09f05aac6..62ff10a72e 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3337,7 +3337,7 @@ gtk_notebook_detach_tab (GtkNotebook *notebook, GtkWidget *child) { notebook->remove_in_detach = TRUE; - gtk_container_remove (GTK_CONTAINER (notebook), child); + gtk_notebook_remove (notebook, child); notebook->remove_in_detach = FALSE; } @@ -5555,7 +5555,7 @@ gtk_notebook_menu_item_recreate (GtkNotebook *notebook, GtkWidget *menu_item = gtk_widget_get_parent (page->menu_label); gtk_container_remove (GTK_CONTAINER (menu_item), page->menu_label); - gtk_container_remove (GTK_CONTAINER (notebook->menu), menu_item); + gtk_widget_unparent (menu_item); gtk_notebook_menu_item_create (notebook, page); } @@ -5810,8 +5810,7 @@ gtk_notebook_remove_page (GtkNotebook *notebook, list = g_list_last (notebook->children); if (list) - gtk_container_remove (GTK_CONTAINER (notebook), - ((GtkNotebookPage *) list->data)->child); + gtk_notebook_remove (notebook, ((GtkNotebookPage *) list->data)->child); } /* Public GtkNotebook Page Switch Methods : @@ -6627,8 +6626,7 @@ gtk_notebook_set_menu_label (GtkNotebook *notebook, if (page->menu_label) { if (notebook->menu) - gtk_container_remove (GTK_CONTAINER (notebook->menu), - gtk_widget_get_parent (page->menu_label)); + gtk_widget_destroy (gtk_widget_get_parent (page->menu_label)); g_clear_object (&page->menu_label); } diff --git a/tests/testgtk.c b/tests/testgtk.c index 244cfe08bc..d1463810f0 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -3881,9 +3881,11 @@ rotate_notebook (GtkButton *button, static void show_all_pages (GtkButton *button, GtkNotebook *notebook) -{ - gtk_container_foreach (GTK_CONTAINER (notebook), - (GtkCallback) gtk_widget_show, NULL); +{ + int i; + + for (i = 0; i < gtk_notebook_get_n_pages (notebook); i++) + gtk_widget_show (gtk_notebook_get_nth_page (notebook, i)); } static void