]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtksizegroup.sgml
Make 3.0 parallel-installable to 2.x
[~andy/gtk] / docs / reference / gtk / tmpl / gtksizegroup.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkSizeGroup
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Grouping widgets so they request the same size
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 #GtkSizeGroup provides a mechanism for grouping a number of widgets
10 together so they all request the same amount of space.  This is
11 typically useful when you want a column of widgets to have the same
12 size, but you can't use a #GtkTable widget.
13 </para>
14 <para>
15 In detail, the size requested for each widget in a #GtkSizeGroup is
16 the maximum of the sizes that would have been requested for each
17 widget in the size group if they were not in the size group. The mode
18 of the size group (see gtk_size_group_set_mode()) determines whether
19 this applies to the horizontal size, the vertical size, or both sizes.
20 </para>
21 <para>
22 Note that size groups only affect the amount of space requested, not
23 the size that the widgets finally receive. If you want the widgets in
24 a #GtkSizeGroup to actually be the same size, you need to pack them in
25 such a way that they get the size they request and not more. For
26 example, if you are packing your widgets into a table, you would not
27 include the %GTK_FILL flag.
28 </para>
29 <para>
30 #GtkSizeGroup objects are referenced by each widget in the size group,
31 so once you have added all widgets to a #GtkSizeGroup, you can drop
32 the initial reference to the size group with g_object_unref(). If the
33 widgets in the size group are subsequently destroyed, then they will
34 be removed from the size group and drop their references on the size
35 group; when all widgets have been removed, the size group will be
36 freed.
37 </para>
38 <para>
39 Widgets can be part of multiple size groups; GTK+ will compute the
40 horizontal size of a widget from the horizontal requisition of all
41 widgets that can be reached from the widget by a chain of size groups
42 of type %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_BOTH, and the
43 vertical size from the vertical requisition of all widgets that can be
44 reached from the widget by a chain of size groups of type
45 %GTK_SIZE_GROUP_VERTICAL or %GTK_SIZE_GROUP_BOTH.
46 </para>
47 <refsect2 id="GtkSizeGroup-BUILDER-UI">
48 <title>GtkSizeGroup as GtkBuildable</title>
49 <para>
50 Size groups can be specified in a UI definition by placing an
51 &lt;object&gt; element with <literal>class="GtkSizeGroup"</literal>
52 somewhere in the UI definition. The widgets that belong to the
53 size group are specified by a &lt;widgets&gt; element that may
54 contain multiple &lt;widget&gt; elements, one for each member
55 of the size group. The name attribute gives the id of the widget.
56 </para>
57 <example>
58 <title>A UI definition fragment with GtkSizeGroup</title>
59 <programlisting><![CDATA[
60 <object class="GtkSizeGroup">
61   <property name="mode">GTK_SIZE_GROUP_HORIZONTAL</property>
62   <widgets>
63     <widget name="radio1"/>
64     <widget name="radio2"/>
65   </widgets>
66 </object>
67 ]]></programlisting>
68 </example>
69 </refsect2>
70
71 <!-- ##### SECTION See_Also ##### -->
72 <para>
73
74 </para>
75
76 <!-- ##### SECTION Stability_Level ##### -->
77
78
79 <!-- ##### SECTION Image ##### -->
80
81
82 <!-- ##### STRUCT GtkSizeGroup ##### -->
83 <para>
84
85 </para>
86
87
88 <!-- ##### ARG GtkSizeGroup:ignore-hidden ##### -->
89 <para>
90
91 </para>
92
93 <!-- ##### ARG GtkSizeGroup:mode ##### -->
94 <para>
95
96 </para>
97
98 <!-- ##### ENUM GtkSizeGroupMode ##### -->
99 <para>
100
101 </para>
102
103 @GTK_SIZE_GROUP_NONE: 
104 @GTK_SIZE_GROUP_HORIZONTAL: 
105 @GTK_SIZE_GROUP_VERTICAL: 
106 @GTK_SIZE_GROUP_BOTH: 
107
108 <!-- ##### FUNCTION gtk_size_group_new ##### -->
109 <para>
110
111 </para>
112
113 @mode: 
114 @Returns: 
115
116
117 <!-- ##### FUNCTION gtk_size_group_set_mode ##### -->
118 <para>
119
120 </para>
121
122 @size_group: 
123 @mode: 
124
125
126 <!-- ##### FUNCTION gtk_size_group_get_mode ##### -->
127 <para>
128
129 </para>
130
131 @size_group: 
132 @Returns: 
133
134
135 <!-- ##### FUNCTION gtk_size_group_set_ignore_hidden ##### -->
136 <para>
137
138 </para>
139
140 @size_group: 
141 @ignore_hidden: 
142
143
144 <!-- ##### FUNCTION gtk_size_group_get_ignore_hidden ##### -->
145 <para>
146
147 </para>
148
149 @size_group: 
150 @Returns: 
151
152
153 <!-- ##### FUNCTION gtk_size_group_add_widget ##### -->
154 <para>
155
156 </para>
157
158 @size_group: 
159 @widget: 
160
161
162 <!-- ##### FUNCTION gtk_size_group_remove_widget ##### -->
163 <para>
164
165 </para>
166
167 @size_group: 
168 @widget: 
169
170
171 <!-- ##### FUNCTION gtk_size_group_get_widgets ##### -->
172 <para>
173
174 </para>
175
176 @size_group: 
177 @Returns: 
178
179