1 /* GTK - The GIMP Toolkit
3 * Copyright (C) 2001 Red Hat Software
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
24 #include "gtkbuildable.h"
25 #include "gtkcontainer.h"
27 #include "gtktypebuiltins.h"
28 #include "gtkprivate.h"
29 #include "gtksizegroup-private.h"
30 #include "gtkwidgetprivate.h"
31 #include "gtkcontainerprivate.h"
35 * SECTION:gtksizegroup
36 * @Short_description: Grouping widgets so they request the same size
37 * @Title: GtkSizeGroup
39 * #GtkSizeGroup provides a mechanism for grouping a number of widgets
40 * together so they all request the same amount of space. This is
41 * typically useful when you want a column of widgets to have the same
42 * size, but you can't use a #GtkGrid widget.
44 * In detail, the size requested for each widget in a #GtkSizeGroup is
45 * the maximum of the sizes that would have been requested for each
46 * widget in the size group if they were not in the size group. The mode
47 * of the size group (see gtk_size_group_set_mode()) determines whether
48 * this applies to the horizontal size, the vertical size, or both sizes.
50 * Note that size groups only affect the amount of space requested, not
51 * the size that the widgets finally receive. If you want the widgets in
52 * a #GtkSizeGroup to actually be the same size, you need to pack them in
53 * such a way that they get the size they request and not more. For
54 * example, if you are packing your widgets into a table, you would not
55 * include the %GTK_FILL flag.
57 * #GtkSizeGroup objects are referenced by each widget in the size group,
58 * so once you have added all widgets to a #GtkSizeGroup, you can drop
59 * the initial reference to the size group with g_object_unref(). If the
60 * widgets in the size group are subsequently destroyed, then they will
61 * be removed from the size group and drop their references on the size
62 * group; when all widgets have been removed, the size group will be
65 * Widgets can be part of multiple size groups; GTK+ will compute the
66 * horizontal size of a widget from the horizontal requisition of all
67 * widgets that can be reached from the widget by a chain of size groups
68 * of type %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_BOTH, and the
69 * vertical size from the vertical requisition of all widgets that can be
70 * reached from the widget by a chain of size groups of type
71 * %GTK_SIZE_GROUP_VERTICAL or %GTK_SIZE_GROUP_BOTH.
73 * Note that only non-contextual sizes of every widget are ever consulted
74 * by size groups (since size groups have no knowledge of what size a widget
75 * will be allocated in one dimension, it cannot derive how much height
76 * a widget will receive for a given width). When grouping widgets that
77 * trade height for width in mode %GTK_SIZE_GROUP_VERTICAL or %GTK_SIZE_GROUP_BOTH:
78 * the height for the minimum width will be the requested height for all
79 * widgets in the group. The same is of course true when horizontally grouping
80 * width for height widgets.
82 * Widgets that trade height-for-width should set a reasonably large minimum width
83 * by way of #GtkLabel:width-chars for instance. Widgets with static sizes as well
84 * as widgets that grow (such as ellipsizing text) need no such considerations.
86 * <refsect2 id="GtkSizeGroup-BUILDER-UI">
87 * <title>GtkSizeGroup as GtkBuildable</title>
89 * Size groups can be specified in a UI definition by placing an
90 * <object> element with <literal>class="GtkSizeGroup"</literal>
91 * somewhere in the UI definition. The widgets that belong to the
92 * size group are specified by a <widgets> element that may
93 * contain multiple <widget> elements, one for each member
94 * of the size group. The name attribute gives the id of the widget.
97 * <title>A UI definition fragment with GtkSizeGroup</title>
98 * <programlisting><![CDATA[
99 * <object class="GtkSizeGroup">
100 * <property name="mode">GTK_SIZE_GROUP_HORIZONTAL</property>
102 * <widget name="radio1"/>
103 * <widget name="radio2"/>
106 * ]]></programlisting>
113 struct _GtkSizeGroupPrivate
115 GtkRequisition minimum_req;
116 GtkRequisition natural_req;
122 guint have_width : 1;
123 guint have_height : 1;
124 guint ignore_hidden : 1;
134 static void gtk_size_group_set_property (GObject *object,
138 static void gtk_size_group_get_property (GObject *object,
143 static void add_group_to_closure (GtkSizeGroup *group,
144 GtkSizeGroupMode mode,
147 static void add_widget_to_closure (GtkWidget *widget,
148 GtkSizeGroupMode mode,
153 static void gtk_size_group_buildable_init (GtkBuildableIface *iface);
154 static gboolean gtk_size_group_buildable_custom_tag_start (GtkBuildable *buildable,
157 const gchar *tagname,
158 GMarkupParser *parser,
160 static void gtk_size_group_buildable_custom_finished (GtkBuildable *buildable,
163 const gchar *tagname,
167 mark_group_unvisited (GtkSizeGroup *group)
169 group->priv->visited = FALSE;
173 mark_widget_unvisited (GtkWidget *widget)
175 _gtk_widget_set_sizegroup_visited (widget, FALSE);
179 add_group_to_closure (GtkSizeGroup *group,
180 GtkSizeGroupMode mode,
184 GtkSizeGroupPrivate *priv = group->priv;
187 *groups = g_slist_prepend (*groups, group);
188 priv->visited = TRUE;
190 tmp_widgets = priv->widgets;
193 GtkWidget *tmp_widget = tmp_widgets->data;
195 if (!_gtk_widget_get_sizegroup_visited (tmp_widget))
196 add_widget_to_closure (tmp_widget, mode, groups, widgets);
198 tmp_widgets = tmp_widgets->next;
203 add_widget_to_closure (GtkWidget *widget,
204 GtkSizeGroupMode mode,
210 *widgets = g_slist_prepend (*widgets, widget);
211 _gtk_widget_set_sizegroup_visited (widget, TRUE);
213 tmp_groups = _gtk_widget_get_sizegroups (widget);
216 GtkSizeGroup *tmp_group = tmp_groups->data;
217 GtkSizeGroupPrivate *tmp_priv = tmp_group->priv;
219 if ((tmp_priv->mode == GTK_SIZE_GROUP_BOTH || tmp_priv->mode == mode) &&
220 !tmp_group->priv->visited)
221 add_group_to_closure (tmp_group, mode, groups, widgets);
223 tmp_groups = tmp_groups->next;
228 real_queue_resize (GtkWidget *widget,
229 GtkQueueResizeFlags flags)
231 GtkWidget *container;
233 _gtk_widget_set_alloc_needed (widget, TRUE);
234 _gtk_widget_set_width_request_needed (widget, TRUE);
235 _gtk_widget_set_height_request_needed (widget, TRUE);
237 container = gtk_widget_get_parent (widget);
239 gtk_widget_is_toplevel (widget) && GTK_IS_CONTAINER (widget))
244 if (flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY)
245 _gtk_container_resize_invalidate (GTK_CONTAINER (container));
247 _gtk_container_queue_resize (GTK_CONTAINER (container));
252 reset_group_sizes (GSList *groups)
254 GSList *tmp_list = groups;
257 GtkSizeGroup *tmp_group = tmp_list->data;
258 GtkSizeGroupPrivate *tmp_priv = tmp_group->priv;
260 tmp_priv->have_width = FALSE;
261 tmp_priv->have_height = FALSE;
263 tmp_list = tmp_list->next;
268 queue_resize_on_widget (GtkWidget *widget,
269 gboolean check_siblings,
270 GtkQueueResizeFlags flags)
272 GtkWidget *parent = widget;
277 GSList *widget_groups;
281 if (widget == parent && !check_siblings)
283 real_queue_resize (widget, flags);
284 parent = gtk_widget_get_parent (parent);
288 widget_groups = _gtk_widget_get_sizegroups (parent);
291 if (widget == parent)
292 real_queue_resize (widget, flags);
294 parent = gtk_widget_get_parent (parent);
301 add_widget_to_closure (parent, GTK_SIZE_GROUP_HORIZONTAL, &groups, &widgets);
302 g_slist_foreach (widgets, (GFunc)mark_widget_unvisited, NULL);
303 g_slist_foreach (groups, (GFunc)mark_group_unvisited, NULL);
305 reset_group_sizes (groups);
310 if (tmp_list->data == parent)
312 if (widget == parent)
313 real_queue_resize (parent, flags);
315 else if (tmp_list->data == widget)
317 g_warning ("A container and its child are part of this SizeGroup");
320 queue_resize_on_widget (tmp_list->data, FALSE, flags);
322 tmp_list = tmp_list->next;
325 g_slist_free (widgets);
326 g_slist_free (groups);
331 add_widget_to_closure (parent, GTK_SIZE_GROUP_VERTICAL, &groups, &widgets);
332 g_slist_foreach (widgets, (GFunc)mark_widget_unvisited, NULL);
333 g_slist_foreach (groups, (GFunc)mark_group_unvisited, NULL);
335 reset_group_sizes (groups);
340 if (tmp_list->data == parent)
342 if (widget == parent)
343 real_queue_resize (parent, flags);
345 else if (tmp_list->data == widget)
347 g_warning ("A container and its child are part of this SizeGroup");
350 queue_resize_on_widget (tmp_list->data, FALSE, flags);
352 tmp_list = tmp_list->next;
355 g_slist_free (widgets);
356 g_slist_free (groups);
358 parent = gtk_widget_get_parent (parent);
363 queue_resize_on_group (GtkSizeGroup *size_group)
365 GtkSizeGroupPrivate *priv = size_group->priv;
368 queue_resize_on_widget (priv->widgets->data, TRUE, 0);
372 gtk_size_group_class_init (GtkSizeGroupClass *klass)
374 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
376 gobject_class->set_property = gtk_size_group_set_property;
377 gobject_class->get_property = gtk_size_group_get_property;
379 g_object_class_install_property (gobject_class,
381 g_param_spec_enum ("mode",
383 P_("The directions in which the size group affects the requested sizes"
384 " of its component widgets"),
385 GTK_TYPE_SIZE_GROUP_MODE,
386 GTK_SIZE_GROUP_HORIZONTAL, GTK_PARAM_READWRITE));
389 * GtkSizeGroup:ignore-hidden:
391 * If %TRUE, unmapped widgets are ignored when determining
392 * the size of the group.
396 g_object_class_install_property (gobject_class,
398 g_param_spec_boolean ("ignore-hidden",
400 P_("If TRUE, unmapped widgets are ignored "
401 "when determining the size of the group"),
403 GTK_PARAM_READWRITE));
405 g_type_class_add_private (klass, sizeof (GtkSizeGroupPrivate));
409 gtk_size_group_init (GtkSizeGroup *size_group)
411 GtkSizeGroupPrivate *priv;
413 size_group->priv = G_TYPE_INSTANCE_GET_PRIVATE (size_group,
415 GtkSizeGroupPrivate);
416 priv = size_group->priv;
418 priv->widgets = NULL;
419 priv->mode = GTK_SIZE_GROUP_HORIZONTAL;
420 priv->have_width = 0;
421 priv->have_height = 0;
422 priv->ignore_hidden = 0;
423 priv->visited = FALSE;
427 gtk_size_group_buildable_init (GtkBuildableIface *iface)
429 iface->custom_tag_start = gtk_size_group_buildable_custom_tag_start;
430 iface->custom_finished = gtk_size_group_buildable_custom_finished;
433 G_DEFINE_TYPE_WITH_CODE (GtkSizeGroup, gtk_size_group, G_TYPE_OBJECT,
434 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
435 gtk_size_group_buildable_init))
438 gtk_size_group_set_property (GObject *object,
443 GtkSizeGroup *size_group = GTK_SIZE_GROUP (object);
448 gtk_size_group_set_mode (size_group, g_value_get_enum (value));
450 case PROP_IGNORE_HIDDEN:
451 gtk_size_group_set_ignore_hidden (size_group, g_value_get_boolean (value));
454 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
460 gtk_size_group_get_property (GObject *object,
465 GtkSizeGroup *size_group = GTK_SIZE_GROUP (object);
466 GtkSizeGroupPrivate *priv = size_group->priv;
471 g_value_set_enum (value, priv->mode);
473 case PROP_IGNORE_HIDDEN:
474 g_value_set_boolean (value, priv->ignore_hidden);
477 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
483 * gtk_size_group_new:
484 * @mode: the mode for the new size group.
486 * Create a new #GtkSizeGroup.
488 * Return value: a newly created #GtkSizeGroup
491 gtk_size_group_new (GtkSizeGroupMode mode)
493 GtkSizeGroup *size_group = g_object_new (GTK_TYPE_SIZE_GROUP, NULL);
494 GtkSizeGroupPrivate *priv = size_group->priv;
502 * gtk_size_group_set_mode:
503 * @size_group: a #GtkSizeGroup
504 * @mode: the mode to set for the size group.
506 * Sets the #GtkSizeGroupMode of the size group. The mode of the size
507 * group determines whether the widgets in the size group should
508 * all have the same horizontal requisition (%GTK_SIZE_GROUP_HORIZONTAL)
509 * all have the same vertical requisition (%GTK_SIZE_GROUP_VERTICAL),
510 * or should all have the same requisition in both directions
511 * (%GTK_SIZE_GROUP_BOTH).
514 gtk_size_group_set_mode (GtkSizeGroup *size_group,
515 GtkSizeGroupMode mode)
517 GtkSizeGroupPrivate *priv;
519 g_return_if_fail (GTK_IS_SIZE_GROUP (size_group));
521 priv = size_group->priv;
523 if (priv->mode != mode)
525 if (priv->mode != GTK_SIZE_GROUP_NONE)
526 queue_resize_on_group (size_group);
528 if (priv->mode != GTK_SIZE_GROUP_NONE)
529 queue_resize_on_group (size_group);
531 g_object_notify (G_OBJECT (size_group), "mode");
536 * gtk_size_group_get_mode:
537 * @size_group: a #GtkSizeGroup
539 * Gets the current mode of the size group. See gtk_size_group_set_mode().
541 * Return value: the current mode of the size group.
544 gtk_size_group_get_mode (GtkSizeGroup *size_group)
546 g_return_val_if_fail (GTK_IS_SIZE_GROUP (size_group), GTK_SIZE_GROUP_BOTH);
548 return size_group->priv->mode;
552 * gtk_size_group_set_ignore_hidden:
553 * @size_group: a #GtkSizeGroup
554 * @ignore_hidden: whether unmapped widgets should be ignored
555 * when calculating the size
557 * Sets whether unmapped widgets should be ignored when
558 * calculating the size.
563 gtk_size_group_set_ignore_hidden (GtkSizeGroup *size_group,
564 gboolean ignore_hidden)
566 GtkSizeGroupPrivate *priv;
568 g_return_if_fail (GTK_IS_SIZE_GROUP (size_group));
570 priv = size_group->priv;
572 ignore_hidden = ignore_hidden != FALSE;
574 if (priv->ignore_hidden != ignore_hidden)
576 priv->ignore_hidden = ignore_hidden;
578 g_object_notify (G_OBJECT (size_group), "ignore-hidden");
583 * gtk_size_group_get_ignore_hidden:
584 * @size_group: a #GtkSizeGroup
586 * Returns if invisible widgets are ignored when calculating the size.
588 * Returns: %TRUE if invisible widgets are ignored.
593 gtk_size_group_get_ignore_hidden (GtkSizeGroup *size_group)
595 g_return_val_if_fail (GTK_IS_SIZE_GROUP (size_group), FALSE);
597 return size_group->priv->ignore_hidden;
601 gtk_size_group_widget_destroyed (GtkWidget *widget,
602 GtkSizeGroup *size_group)
604 gtk_size_group_remove_widget (size_group, widget);
608 * gtk_size_group_add_widget:
609 * @size_group: a #GtkSizeGroup
610 * @widget: the #GtkWidget to add
612 * Adds a widget to a #GtkSizeGroup. In the future, the requisition
613 * of the widget will be determined as the maximum of its requisition
614 * and the requisition of the other widgets in the size group.
615 * Whether this applies horizontally, vertically, or in both directions
616 * depends on the mode of the size group. See gtk_size_group_set_mode().
618 * When the widget is destroyed or no longer referenced elsewhere, it will
619 * be removed from the size group.
622 gtk_size_group_add_widget (GtkSizeGroup *size_group,
625 GtkSizeGroupPrivate *priv;
628 g_return_if_fail (GTK_IS_SIZE_GROUP (size_group));
629 g_return_if_fail (GTK_IS_WIDGET (widget));
631 priv = size_group->priv;
633 groups = _gtk_widget_get_sizegroups (widget);
635 if (!g_slist_find (groups, size_group))
637 _gtk_widget_add_sizegroup (widget, size_group);
639 priv->widgets = g_slist_prepend (priv->widgets, widget);
641 g_signal_connect (widget, "destroy",
642 G_CALLBACK (gtk_size_group_widget_destroyed),
645 g_object_ref (size_group);
648 queue_resize_on_group (size_group);
652 * gtk_size_group_remove_widget:
653 * @size_group: a #GtkSizeGroup
654 * @widget: the #GtkWidget to remove
656 * Removes a widget from a #GtkSizeGroup.
659 gtk_size_group_remove_widget (GtkSizeGroup *size_group,
662 GtkSizeGroupPrivate *priv;
664 g_return_if_fail (GTK_IS_SIZE_GROUP (size_group));
665 g_return_if_fail (GTK_IS_WIDGET (widget));
667 priv = size_group->priv;
669 g_return_if_fail (g_slist_find (priv->widgets, widget));
671 g_signal_handlers_disconnect_by_func (widget,
672 gtk_size_group_widget_destroyed,
675 _gtk_widget_remove_sizegroup (widget, size_group);
677 priv->widgets = g_slist_remove (priv->widgets, widget);
678 queue_resize_on_group (size_group);
679 gtk_widget_queue_resize (widget);
681 g_object_unref (size_group);
685 * gtk_size_group_get_widgets:
686 * @size_group: a #GtkSizeGroup
688 * Returns the list of widgets associated with @size_group.
690 * Return value: (element-type GtkWidget) (transfer none): a #GSList of
691 * widgets. The list is owned by GTK+ and should not be modified.
696 gtk_size_group_get_widgets (GtkSizeGroup *size_group)
698 return size_group->priv->widgets;
702 compute_dimension (GtkWidget *widget,
703 GtkSizeGroupMode mode,
704 gint *minimum, /* in-out */
705 gint *natural) /* in-out */
707 GSList *widgets = NULL;
708 GSList *groups = NULL;
710 gint min_result = 0, nat_result = 0;
712 add_widget_to_closure (widget, mode, &groups, &widgets);
713 g_slist_foreach (widgets, (GFunc)mark_widget_unvisited, NULL);
714 g_slist_foreach (groups, (GFunc)mark_group_unvisited, NULL);
716 g_slist_foreach (widgets, (GFunc)g_object_ref, NULL);
720 min_result = *minimum;
721 nat_result = *natural;
725 GtkSizeGroup *group = groups->data;
726 GtkSizeGroupPrivate *priv = group->priv;
728 if (mode == GTK_SIZE_GROUP_HORIZONTAL && priv->have_width)
730 min_result = priv->minimum_req.width;
731 nat_result = priv->natural_req.width;
733 else if (mode == GTK_SIZE_GROUP_VERTICAL && priv->have_height)
735 min_result = priv->minimum_req.height;
736 nat_result = priv->natural_req.height;
743 GtkWidget *tmp_widget = tmp_list->data;
744 gint min_dimension, nat_dimension;
746 if (tmp_widget == widget)
748 min_dimension = *minimum;
749 nat_dimension = *natural;
753 if (mode == GTK_SIZE_GROUP_HORIZONTAL)
754 gtk_widget_get_preferred_width (tmp_widget, &min_dimension, &nat_dimension);
756 gtk_widget_get_preferred_height (tmp_widget, &min_dimension, &nat_dimension);
759 if (gtk_widget_get_mapped (tmp_widget) || !priv->ignore_hidden)
761 min_result = MAX (min_result, min_dimension);
762 nat_result = MAX (nat_result, nat_dimension);
765 tmp_list = tmp_list->next;
771 GtkSizeGroup *tmp_group = tmp_list->data;
772 GtkSizeGroupPrivate *tmp_priv = tmp_group->priv;
774 if (mode == GTK_SIZE_GROUP_HORIZONTAL)
776 tmp_priv->have_width = TRUE;
777 tmp_priv->minimum_req.width = min_result;
778 tmp_priv->natural_req.width = nat_result;
782 tmp_priv->have_height = TRUE;
783 tmp_priv->minimum_req.height = min_result;
784 tmp_priv->natural_req.height = nat_result;
787 tmp_list = tmp_list->next;
792 g_slist_foreach (widgets, (GFunc)g_object_unref, NULL);
794 g_slist_free (widgets);
795 g_slist_free (groups);
797 *minimum = min_result;
798 *natural = nat_result;
802 * _gtk_size_group_bump_requisition:
803 * @widget: a #GtkWidget
804 * @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending
805 * on the dimension in which to bump the size.
806 * @minimum: a pointer to the widget's minimum size
807 * @natural: a pointer to the widget's natural size
809 * Refreshes the sizegroup while returning the groups requested
810 * value in the dimension @mode.
812 * This function is used both to update sizegroup minimum and natural size
813 * information and widget minimum and natural sizes in multiple passes from
814 * the size request apis.
817 _gtk_size_group_bump_requisition (GtkWidget *widget,
818 GtkSizeGroupMode mode,
822 if (!_gtk_widget_get_sizegroup_bumping (widget))
824 /* Avoid recursion here */
825 _gtk_widget_set_sizegroup_bumping (widget, TRUE);
827 if (_gtk_widget_get_sizegroups (widget))
828 compute_dimension (widget, mode, minimum, natural);
830 _gtk_widget_set_sizegroup_bumping (widget, FALSE);
837 * _gtk_size_group_queue_resize:
838 * @widget: a #GtkWidget
840 * Queue a resize on a widget, and on all other widgets grouped with this widget.
843 _gtk_size_group_queue_resize (GtkWidget *widget,
844 GtkQueueResizeFlags flags)
846 queue_resize_on_widget (widget, TRUE, flags);
852 } GSListSubParserData;
855 size_group_start_element (GMarkupParseContext *context,
856 const gchar *element_name,
858 const gchar **values,
863 GSListSubParserData *data = (GSListSubParserData*)user_data;
865 if (strcmp (element_name, "widget") == 0)
866 for (i = 0; names[i]; i++)
867 if (strcmp (names[i], "name") == 0)
868 data->items = g_slist_prepend (data->items, g_strdup (values[i]));
869 else if (strcmp (element_name, "widgets") == 0)
872 g_warning ("Unsupported type tag for GtkSizeGroup: %s\n",
877 static const GMarkupParser size_group_parser =
879 size_group_start_element
883 gtk_size_group_buildable_custom_tag_start (GtkBuildable *buildable,
886 const gchar *tagname,
887 GMarkupParser *parser,
890 GSListSubParserData *parser_data;
895 if (strcmp (tagname, "widgets") == 0)
897 parser_data = g_slice_new0 (GSListSubParserData);
898 parser_data->items = NULL;
899 parser_data->object = G_OBJECT (buildable);
901 *parser = size_group_parser;
910 gtk_size_group_buildable_custom_finished (GtkBuildable *buildable,
913 const gchar *tagname,
917 GSListSubParserData *data;
920 if (strcmp (tagname, "widgets"))
923 data = (GSListSubParserData*)user_data;
924 data->items = g_slist_reverse (data->items);
926 for (l = data->items; l; l = l->next)
928 object = gtk_builder_get_object (builder, l->data);
931 g_warning ("Unknown object %s specified in sizegroup %s",
932 (const gchar*)l->data,
933 gtk_buildable_get_name (GTK_BUILDABLE (data->object)));
936 gtk_size_group_add_widget (GTK_SIZE_GROUP (data->object),
937 GTK_WIDGET (object));
940 g_slist_free (data->items);
941 g_slice_free (GSListSubParserData, data);