Commit 85a47fc0 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

Fix glade_util_container_get_all_children()

gtk_container_forall() no longer returns all children for all classes

For example in GtkActionBar forall() only returns the internal revealer child
and foreach() returns all the widgets added by the user which are inside a
box which parent its the internal revealer

So in order to get all the children we need to call forall() and foreach() and remove duplicates

This fixes bug #778537 "ActionBar need placeholder"
parent 9888e98a
......@@ -633,7 +633,8 @@ gtk_container_children_callback (GtkWidget *widget, gpointer client_data)
GList **children;
children = (GList **) client_data;
*children = g_list_prepend (*children, widget);
if (!g_list_find (*children, widget))
*children = g_list_prepend (*children, widget);
}
/**
......@@ -657,6 +658,7 @@ glade_util_container_get_all_children (GtkContainer *container)
g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
gtk_container_forall (container, gtk_container_children_callback, &children);
gtk_container_foreach (container, gtk_container_children_callback, &children);
/* Preserve the natural order by reversing the list */
return g_list_reverse (children);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment