[glade/glade-3-20] Fix glade_util_container_get_all_children()
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/glade-3-20] Fix glade_util_container_get_all_children()
- Date: Tue, 6 Mar 2018 22:58:21 +0000 (UTC)
commit 3a4ad916c0ec181698fd5aae929b7f34d1d31a52
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Tue Mar 6 19:51:12 2018 -0300
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"
gladeui/glade-utils.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
index 3365f7a..ce3342c 100644
--- a/gladeui/glade-utils.c
+++ b/gladeui/glade-utils.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]