summaryrefslogtreecommitdiff
path: root/gtk/gtkbox.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2016-02-12 13:21:14 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2016-02-12 13:29:21 +0100
commit170cb016759c4a949c7cd81291da498395f18fb3 (patch)
tree6a995a0c4c1750eb848405c8d8a5315a92289346 /gtk/gtkbox.c
parent452d25b13ddfdcd194a56df9605f83c80f86af95 (diff)
downloadgtk+-170cb016759c4a949c7cd81291da498395f18fb3.tar.gz
Revert "Remove _gtk_box_get_children"
This reverts commit 572e9a04027e213082a5b257e5d662a5daa32667. _gtk_box_get_children was not doing exactly the same than gtk_container_get_children does, because the latter uses the forall implementation of GtkBox that takes into account the children pack mode while the former just iterated the list of children. This broke the order of the buttons in a GtkButtonBox when they were packaged with PACK_END.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r--gtk/gtkbox.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index d1a6edea6c..d0e9d3dc0f 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -2674,6 +2674,30 @@ gtk_box_forall (GtkContainer *container,
}
}
+GList *
+_gtk_box_get_children (GtkBox *box)
+{
+ GtkBoxPrivate *priv;
+ GtkBoxChild *child;
+ GList *children;
+ GList *retval = NULL;
+
+ g_return_val_if_fail (GTK_IS_BOX (box), NULL);
+
+ priv = box->priv;
+
+ children = priv->children;
+ while (children)
+ {
+ child = children->data;
+ children = children->next;
+
+ retval = g_list_prepend (retval, child->widget);
+ }
+
+ return g_list_reverse (retval);
+}
+
/**
* gtk_box_set_center_widget:
* @box: a #GtkBox