summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkbox.sgml
blob: eb42208d3a73efbadfd7391704b9d82c476315de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!-- ##### SECTION Title ##### -->
GtkBox

<!-- ##### SECTION Short_Description ##### -->
Base class for box containers

<!-- ##### SECTION Long_Description ##### -->
<para>
GtkBox is an abstract widget which encapsulates functionality for a
particular kind of container, one that organizes a variable number of
widgets into a rectangular area.  GtkBox has a number of derived
classes, e.g. #GtkHBox and #GtkVBox.
</para>
<para>
The rectangular area of a GtkBox is organized into either a single row
or a single column of child widgets depending upon whether the box is
of type #GtkHBox or #GtkVBox, respectively.  Thus, all children of a
GtkBox are allocated one dimension in common, which is the height of a
row, or the width of a column.
</para>
<para>
GtkBox uses a notion of <emphasis>packing</emphasis>.  Packing refers to
adding widgets with reference to a particular position in a
#GtkContainer.  For a GtkBox, there are two reference positions: the
<emphasis>start</emphasis> and the <emphasis>end</emphasis> of the box.  
For a #GtkVBox, the start is defined as the top of the box and the end is
defined as the bottom.  For a #GtkHBox the start is defined as the
left side and the end is defined as the right side.
</para>
<para>
Use repeated calls to gtk_box_pack_start() to pack widgets into a
GtkBox from start to end.  Use gtk_box_pack_end() to add widgets from
end to start.  You may intersperse these calls and add widgets from
both ends of the same GtkBox.
</para>
<para>
Use gtk_box_pack_start_defaults() or gtk_box_pack_end_defaults()
to pack widgets into a GtkBox if you do not need to specify the
#GtkBox:expand, #GtkBox:fill, or #GtkBox:padding child properties 
for the child to be added.
</para>
<para>
Because GtkBox is a #GtkContainer, you may also use
gtk_container_add() to insert widgets into the box, and they will be
packed as if with gtk_box_pack_start_defaults().  Use
gtk_container_remove() to remove widgets from the GtkBox.
</para>
<para>
Use gtk_box_set_homogeneous() to specify whether or not all children
of the GtkBox are forced to get the same amount of space.
</para>
<para>
Use gtk_box_set_spacing() to determine how much space will be
minimally placed between all children in the GtkBox.
</para>
<para>
Use gtk_box_reorder_child() to move a GtkBox child to a different
place in the box.
</para>
<para>
Use gtk_box_set_child_packing() to reset the #GtkBox:expand, 
#GtkBox:fill and #GtkBox:padding child properties.
Use gtk_box_query_child_packing() to query these fields.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>

<varlistentry>
<term>#GtkHBox</term>
<listitem><para>a derived class that organizes widgets into a row.</para></listitem>
</varlistentry>

<varlistentry>
<term>#GtkVBox</term>
<listitem><para>a derived class that organizes widgets into a column.</para></listitem>
</varlistentry>

<varlistentry>
<term>#GtkFrame</term>
<listitem><para>a #GtkWidget useful for drawing a border around a GtkBox.</para></listitem>
</varlistentry>

<varlistentry>
<term>#GtkTable</term>
<listitem><para>a #GtkContainer for organizing widgets into a grid,
rather than independent rows or columns.</para></listitem>
</varlistentry>

<varlistentry>
<term>#GtkLayout</term>
<listitem><para>a #GtkContainer for organizing widgets into arbitrary
layouts.</para></listitem>
</varlistentry>

</variablelist>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GtkBox ##### -->
<para>
The #GtkBox-struct describes an instance of GtkBox and contains the 
following fields.  (These fields should be considered read-only. 
They should never be set by an application.)
</para>


<!-- ##### ARG GtkBox:homogeneous ##### -->
<para>

</para>

<!-- ##### ARG GtkBox:spacing ##### -->
<para>

</para>

<!-- ##### ARG GtkBox:expand ##### -->
<para>

</para>

<!-- ##### ARG GtkBox:fill ##### -->
<para>

</para>

<!-- ##### ARG GtkBox:pack-type ##### -->
<para>

</para>

<!-- ##### ARG GtkBox:padding ##### -->
<para>

</para>

<!-- ##### ARG GtkBox:position ##### -->
<para>

</para>

<!-- ##### STRUCT GtkBoxChild ##### -->
<para>
The #GtkBoxChild-struct holds a child widget of GtkBox and describes
how the child is to be packed into the GtkBox.  Use
gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
and reset the <structfield>padding</structfield>,
<structfield>expand</structfield>, <structfield>fill</structfield>,
and <structfield>pack</structfield> fields.
</para>
<para>
#GtkBoxChild-struct contains the following fields.  (These fields
should be considered read-only. They should never be directly set by an
application.)
</para>

@widget: the child widget, packed into the GtkBox.
@padding: the number of extra pixels to put between this child and its
  neighbors, set when packed, zero by default.
@expand: flag indicates whether extra space should be given to this
  child. Any extra space given to the parent GtkBox is divided up 
  among all children with this attribute set to %TRUE; set when packed, 
  %TRUE by default.
@fill: flag indicates whether any extra space given to this child due 
  to its @expand attribute being set is actually allocated to the child, 
  rather than being used as padding around the widget; set when packed, 
  %TRUE by default.
@pack: one of #GtkPackType indicating whether the child is packed with 
  reference to the start (top/left) or end (bottom/right) of the GtkBox.
@is_secondary: %TRUE if the child is secondary

<!-- ##### FUNCTION gtk_box_pack_start ##### -->
<para>

</para>

@box: 
@child: 
@expand: 
@box
@fill: 
@padding: 


<!-- ##### FUNCTION gtk_box_pack_end ##### -->
<para>

</para>

@box: 
@child: 
@expand: 
@fill: 
@padding: 


<!-- ##### FUNCTION gtk_box_pack_start_defaults ##### -->
<para>

</para>

@box: 
@widget: 


<!-- ##### FUNCTION gtk_box_pack_end_defaults ##### -->
<para>

</para>

@box: 
@widget: 


<!-- ##### FUNCTION gtk_box_get_homogeneous ##### -->
<para>

</para>

@box: 
@Returns: 


<!-- ##### FUNCTION gtk_box_set_homogeneous ##### -->
<para>

</para>

@box: 
@homogeneous: 


<!-- ##### FUNCTION gtk_box_get_spacing ##### -->
<para>

</para>

@box: 
@Returns: 


<!-- ##### FUNCTION gtk_box_set_spacing ##### -->
<para>

</para>

@box: 
@spacing: 


<!-- ##### FUNCTION gtk_box_reorder_child ##### -->
<para>

</para>

@box: 
@child: 
@position: 


<!-- ##### FUNCTION gtk_box_query_child_packing ##### -->
<para>

</para>

@box: 
@child: 
@expand: 
@fill: 
@padding: 
@pack_type: 


<!-- ##### FUNCTION gtk_box_set_child_packing ##### -->
<para>

</para>

@box: 
@child: 
@expand: 
@fill: 
@padding: 
@pack_type: