[glade3] gladeui: Add glade_widget_get_children() convenience layer
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] gladeui: Add glade_widget_get_children() convenience layer
- Date: Fri, 14 May 2010 22:01:21 +0000 (UTC)
commit 3ebc71feca970df9d258b4d6942dac738a9ad128
Author: Johannes Schmid <jhs gnome org>
Date: Sun Apr 18 10:48:06 2010 +0200
gladeui: Add glade_widget_get_children() convenience layer
gladeui/glade-widget.c | 29 +++++++++++++++++++++++++++--
gladeui/glade-widget.h | 2 ++
2 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 7bd82eb..6afa281 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3442,6 +3442,31 @@ glade_widget_set_parent (GladeWidget *widget,
}
/**
+ * glade_widget_get_children
+ * @widget: A #GladeWidget
+ *
+ * Returns: The children of widget
+ */
+GList *
+glade_widget_get_children (GladeWidget* widget)
+{
+ GladeWidgetAdaptor* adaptor = glade_widget_get_adaptor (widget);
+ GList* adaptor_children = NULL;
+ GList* children = NULL;
+ GList* node;
+
+ adaptor_children = glade_widget_adaptor_get_children (adaptor, widget->object);
+ for (node = adaptor_children; node != NULL; node = g_list_next (node))
+ {
+ children = g_list_append (children, node->data);
+ }
+ g_list_free (adaptor_children);
+
+ return children;
+}
+
+
+/**
* glade_widget_get_toplevel:
* @widget: A #GladeWidget
*
@@ -3728,7 +3753,7 @@ glade_widget_read (GladeProject *project,
gchar *klass, *id;
glade_widget_push_superuser ();
-
+
if (!glade_xml_node_verify
(node, GLADE_XML_TAG_WIDGET (glade_project_get_format (project))))
return NULL;
@@ -3792,7 +3817,7 @@ glade_widget_read (GladeProject *project,
}
glade_widget_pop_superuser ();
-
+
return widget;
}
diff --git a/gladeui/glade-widget.h b/gladeui/glade-widget.h
index 7cddce3..3094d6d 100644
--- a/gladeui/glade-widget.h
+++ b/gladeui/glade-widget.h
@@ -412,6 +412,8 @@ GladeWidget *glade_widget_get_parent (GladeWidget *w
void glade_widget_set_parent (GladeWidget *widget,
GladeWidget *parent);
+GList *glade_widget_get_children (GladeWidget* widget);
+
GladeWidget *glade_widget_get_toplevel (GladeWidget *widget);
gboolean glade_widget_superuser (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]