Stop using container api on GtkNotebook

This commit is contained in:
Matthias Clasen 2020-05-08 10:57:21 -04:00
parent c7b7d78ae1
commit 0daa1f3daa
2 changed files with 9 additions and 9 deletions

View File

@ -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);
}

View File

@ -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