[gnome-shell] [StBoxLayout] Add st_box_layout_get_n_children



commit 057f0effedc8bbe1087be0395c8534264a3eec3e
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 10 15:46:30 2009 -0500

    [StBoxLayout] Add st_box_layout_get_n_children
    
    https://bugzilla.gnome.org/show_bug.cgi?id=600734

 src/st/st-box-layout.c |   12 ++++++++++++
 src/st/st-box-layout.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c
index d0371d8..8885f6a 100644
--- a/src/st/st-box-layout.c
+++ b/src/st/st-box-layout.c
@@ -1385,3 +1385,15 @@ st_box_layout_destroy_children (StBoxLayout *self)
 {
   st_box_layout_internal_remove_all (self, TRUE);
 }
+
+/**
+ * st_box_layout_get_n_children:
+ * @self: a #StBoxLayout
+ *
+ * Returns the number of children in this box.
+ */
+guint
+st_box_layout_get_n_children  (StBoxLayout *self)
+{
+  return g_list_length (self->priv->children);
+}
diff --git a/src/st/st-box-layout.h b/src/st/st-box-layout.h
index b57143b..21cd0b7 100644
--- a/src/st/st-box-layout.h
+++ b/src/st/st-box-layout.h
@@ -93,6 +93,8 @@ void     st_box_layout_remove_all     (StBoxLayout *box);
 
 void     st_box_layout_destroy_children (StBoxLayout *box);
 
+guint    st_box_layout_get_n_children  (StBoxLayout *box);
+
 G_END_DECLS
 
 #endif /* _ST_BOX_LAYOUT_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]