diff options
author | Matthias Clasen <maclas@gmx.de> | 2003-07-18 23:08:51 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2003-07-18 23:08:51 +0000 |
commit | 1fd4cd2fa4dd1a99d259ce58c1454d0cd630f4ae (patch) | |
tree | 7b0ceeb9e7ab1a529767ac38cca22e88b07fd205 /gtk/gtkbbox.c | |
parent | 0c8511d269b70279eafe6619f297c13f2a07ad85 (diff) | |
download | gtk+-1fd4cd2fa4dd1a99d259ce58c1454d0cd630f4ae.tar.gz |
New function. (#64562)
2003-07-19 Matthias Clasen <maclas@gmx.de>
* gtk/gtkbbox.h:
* gtk/gtkbbox.c (gtk_button_box_get_child_secondary): New function. (#64562)
Diffstat (limited to 'gtk/gtkbbox.c')
-rw-r--r-- | gtk/gtkbbox.c | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index 15fe55a88e..fade4783ac 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -239,25 +239,12 @@ gtk_button_box_get_child_property (GtkContainer *container, GValue *value, GParamSpec *pspec) { - GList *list; - GtkBoxChild *child_info = NULL; - - list = GTK_BOX (container)->children; - while (list) - { - child_info = list->data; - if (child_info->widget == child) - break; - - list = list->next; - } - - g_assert (list != NULL); - switch (property_id) { case CHILD_PROP_SECONDARY: - g_value_set_boolean (value, child_info->is_secondary); + g_value_set_boolean (value, + gtk_button_box_get_child_secondary (GTK_BUTTON_BOX (container), + child)); break; default: GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec); @@ -339,6 +326,43 @@ gtk_button_box_get_layout (GtkButtonBox *widget) } /** + * gtk_button_box_get_child_secondary: + * @widget: a #GtkButtonBox + * @child: a child of @widget + * + * Returns whether @child should appear in a secondary group of children. + * + * Return value: whether @child should appear in a secondary group of children. + * + * Since: 2.4 + **/ +gboolean +gtk_button_box_get_child_secondary (GtkButtonBox *widget, + GtkWidget *child) +{ + GList *list; + GtkBoxChild *child_info; + + g_return_if_fail (GTK_IS_BUTTON_BOX (widget)); + g_return_if_fail (GTK_IS_WIDGET (child)); + + child_info = NULL; + list = GTK_BOX (widget)->children; + while (list) + { + child_info = list->data; + if (child_info->widget == child) + break; + + list = list->next; + } + + g_return_val_if_fail (list != NULL, FALSE); + + return child_info->is_secondary; +} + +/** * gtk_button_box_set_child_secondary * @widget: a #GtkButtonBox * @child: a child of @widget |