diff options
-rw-r--r-- | gtk/gtkmenusectionbox.c | 16 | ||||
-rw-r--r-- | gtk/gtknotebook.c | 4 | ||||
-rw-r--r-- | gtk/gtkpopovermenu.c | 2 | ||||
-rw-r--r-- | gtk/gtktreepopover.c | 2 |
4 files changed, 9 insertions, 15 deletions
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c index 6a36ae7510..072b3287ca 100644 --- a/gtk/gtkmenusectionbox.c +++ b/gtk/gtkmenusectionbox.c @@ -226,7 +226,7 @@ gtk_menu_section_box_remove_func (gint position, stack = gtk_widget_get_ancestor (GTK_WIDGET (box->toplevel), GTK_TYPE_STACK); subbox = gtk_stack_get_child_by_name (GTK_STACK (stack), gtk_menu_tracker_item_get_label (item)); if (subbox != NULL) - gtk_container_remove (GTK_CONTAINER (stack), subbox); + gtk_stack_remove (GTK_STACK (stack), subbox); } gtk_container_remove (GTK_CONTAINER (box->item_box), @@ -476,18 +476,14 @@ update_popover_position_cb (GObject *source, { GtkPopover *popover = GTK_POPOVER (source); GtkMenuSectionBox *box = GTK_MENU_SECTION_BOX (user_data); + GtkWidget *w; GtkPositionType new_pos = gtk_popover_get_position (popover); - GList *children = gtk_container_get_children (GTK_CONTAINER (gtk_widget_get_parent (GTK_WIDGET (box)))); - GList *l; - - for (l = children; - l != NULL; - l = l->next) + for (w = gtk_widget_get_first_child (gtk_widget_get_parent (GTK_WIDGET (box))); + w != NULL; + w = gtk_widget_get_next_sibling (w)) { - GtkWidget *w = l->data; - if (new_pos == GTK_POS_BOTTOM) gtk_widget_set_valign (w, GTK_ALIGN_START); else if (new_pos == GTK_POS_TOP) @@ -495,8 +491,6 @@ update_popover_position_cb (GObject *source, else gtk_widget_set_valign (w, GTK_ALIGN_CENTER); } - - g_list_free (children); } void diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index eb5ac27d7d..d09f05aac6 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4004,7 +4004,7 @@ gtk_notebook_insert_notebook_page (GtkNotebook *notebook, if (notebook->menu) gtk_notebook_menu_item_create (notebook, page); - gtk_container_add (GTK_CONTAINER (notebook->stack_widget), page->child); + gtk_stack_add_named (GTK_STACK (notebook->stack_widget), page->child, NULL); if (page->tab_label) { @@ -4221,7 +4221,7 @@ gtk_notebook_real_remove (GtkNotebook *notebook, gtk_widget_get_visible (GTK_WIDGET (notebook))) need_resize = TRUE; - gtk_container_remove (GTK_CONTAINER (notebook->stack_widget), page->child); + gtk_stack_remove (GTK_STACK (notebook->stack_widget), page->child); tab_label = page->tab_label; if (tab_label) diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c index cb920d0289..718cfe1d58 100644 --- a/gtk/gtkpopovermenu.c +++ b/gtk/gtkpopovermenu.c @@ -685,7 +685,7 @@ gtk_popover_menu_set_menu_model (GtkPopoverMenu *popover, stack = gtk_popover_get_child (GTK_POPOVER (popover)); while ((child = gtk_widget_get_first_child (stack))) - gtk_container_remove (GTK_CONTAINER (stack), child); + gtk_stack_remove (GTK_STACK (stack), child); if (model) gtk_menu_section_box_new_toplevel (popover, model, popover->flags); diff --git a/gtk/gtktreepopover.c b/gtk/gtktreepopover.c index 636cb5180d..268462ab5c 100644 --- a/gtk/gtktreepopover.c +++ b/gtk/gtktreepopover.c @@ -736,7 +736,7 @@ rebuild_menu (GtkTreePopover *popover) stack = gtk_popover_get_child (GTK_POPOVER (popover)); while ((child = gtk_widget_get_first_child (stack))) - gtk_container_remove (GTK_CONTAINER (stack), child); + gtk_stack_remove (GTK_STACK (stack), child); if (popover->model) gtk_tree_popover_populate (popover); |