summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtktable.sgml
blob: eb18933b7c3c91b961c5160ae5f3fa143a82b3d7 (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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!-- ##### SECTION Title ##### -->
GtkTable

<!-- ##### SECTION Short_Description ##### -->
Pack widgets in regular patterns.

<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkTable functions allow the programmer to arrange widgets in rows and
columns, making it easy to align many widgets next to each other,
horizontally and vertically.
</para>
<para>
Tables are created with a call to gtk_table_new(), the size of which can
later be changed with gtk_table_resize().
</para>
<para>
Widgets can be added to a table using gtk_table_attach() or the more
convenient (but slightly less flexible) gtk_table_attach_defaults().
</para>
<para>
To alter the space next to a specific row, use gtk_table_set_row_spacing(),
and for a column, gtk_table_set_col_spacing().</para>
<para>
The gaps between <emphasis>all</emphasis> rows or columns can be changed by calling
gtk_table_set_row_spacings() or gtk_table_set_col_spacings() respectively.
</para>
<para>
gtk_table_set_homogeneous(), can be used to set whether all cells in the
table will resize themselves to the size of the largest widget in the table.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkVBox</term>
<listitem><para>For packing widgets vertically only.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkHBox</term>
<listitem><para>For packing widgets horizontally only.</para></listitem>
</varlistentry>
</variablelist>
</para>

<!-- ##### STRUCT GtkTable ##### -->
<para>
The <structname>GtkTable</structname> structure holds the data for the actual table itself. 

<structfield>children</structfield> is a #GList of all the widgets the table contains. <structfield>rows</structfield> and <structfield>columns</structfield> are pointers to #GtkTableRowCol structures, which contain the default spacing and expansion details for the #GtkTable's rows and columns, respectively.
</para>
<para>
<structfield>nrows</structfield> and <structfield>ncols</structfield> are 16bit integers storing the number of rows and columns the table has. 
</para>


<!-- ##### STRUCT GtkTableChild ##### -->
<para>
The <structfield>widget</structfield> field is a pointer to the widget that 
this %GtkTableChild structure is keeping track of.
The <structfield>left_attach</structfield>,
<structfield>right_attach</structfield>,
<structfield>top_attach</structfield>, and
<structfield>bottom_attach</structfield> fields specify the row and column
numbers which make up the invisible rectangle that the child widget is packed into.
</para>
<para>
<structfield>xpadding</structfield> and <structfield>ypadding</structfield>
specify the space between this widget and the surrounding table cells.
</para>

@widget: 
@left_attach: 
@right_attach: 
@top_attach: 
@bottom_attach: 
@xpadding: 
@ypadding: 
@xexpand: 
@yexpand: 
@xshrink: 
@yshrink: 
@xfill: 
@yfill: 

<!-- ##### STRUCT GtkTableRowCol ##### -->
<para>
These fields should be considered read-only and not be modified directly.
</para>

@requisition: 
@allocation: 
@spacing: 
@need_expand: 
@need_shrink: 
@expand: 
@shrink: 
@empty: 

<!-- ##### FUNCTION gtk_table_new ##### -->
<para>
Used to create a new table widget. An initial size must be given by
specifying how many rows and columns the table should have, although
this can be changed later with gtk_table_resize().  @rows and @columns
must both be in the range 0 .. 65535.
</para>

@rows: The number of rows the new table should have.
@columns: The number of columns the new table should have.
@homogeneous: If set to %TRUE, all table cells are resized to the size of the cell
containing the largest widget.
@Returns: A pointer to the the newly created table widget.


<!-- ##### FUNCTION gtk_table_resize ##### -->
<para>
If you need to change a table's size <emphasis>after</emphasis> it has been created, this function allows you to do so.
</para>

@table: The #GtkTable you wish to change the size of.
@rows: The new number of rows.
@columns: The new number of columns.


<!-- ##### FUNCTION gtk_table_attach ##### -->
<para>
Adds a widget to a table. The number of 'cells' that a widget will occupy is
specified by @left_attach, @right_attach, @top_attach and @bottom_attach.
These each represent the leftmost, rightmost, uppermost and lowest column
and row numbers of the table. (Columns and rows are indexed from zero).
</para>

@table: The #GtkTable to add a new widget to.
@child: The widget to add.
@left_attach: the column number to attach the left side of a child widget to.
@right_attach: the column number to attach the right side of a child widget to.
@top_attach: the row number to attach the left side of a child widget to.
@bottom_attach: the column number to attach the right side of a child widget to.
@xoptions: Used to specify the properties of the child widget when the table is resized.
@yoptions: The same as xoptions, except this field determines behaviour of vertical resizing.
@xpadding: An integer value specifying the padding on the left and right of the widget being added to the table.
@ypadding: The amount of padding above and below the child widget.


<!-- ##### FUNCTION gtk_table_attach_defaults ##### -->
<para>
As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options.
</para>

@table: The table to add a new child widget to.
@widget: The child widget to add.
@left_attach: The column number to attach the left side of the child widget to.
@right_attach: The column number to attach the right side of the child widget to.
@top_attach: The row number to attach the top of the child widget to.
@bottom_attach: The row number to attach the bottom of the child widget to.


<!-- ##### FUNCTION gtk_table_set_row_spacing ##### -->
<para>
Changes the space between a given table row and its surrounding rows.
</para>

@table: a #GtkTable containing the row whose properties you wish to change.
@row: row number whose spacing will be changed.
@spacing: number of pixels that the spacing should take up.


<!-- ##### FUNCTION gtk_table_set_col_spacing ##### -->
<para>
Alters the amount of space between a given table column and the adjacent columns.
</para>

@table: a #GtkTable.
@column: the column whose spacing should be changed.
@spacing: number of pixels that the spacing should take up.


<!-- ##### FUNCTION gtk_table_set_row_spacings ##### -->
<para>
Sets the space between every row in @table equal to @spacing.
</para>

@table: a #GtkTable.
@spacing: the number of pixels of space to place between every row in the table.


<!-- ##### FUNCTION gtk_table_set_col_spacings ##### -->
<para>
Sets the space between every column in @table equal to @spacing.
</para>

@table: a #GtkTable.
@spacing: the number of pixels of space to place between every column in the table.


<!-- ##### FUNCTION gtk_table_set_homogeneous ##### -->
<para>
Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.
</para>

@table: The #GtkTable you wish to set the homogeneous properties of.
@homogeneous: Set to %TRUE to ensure all table cells are the same size. Set
to %FALSE if this is not your desired behaviour.


<!-- ##### FUNCTION gtk_table_get_default_row_spacing ##### -->
<para>

</para>

@table: 
@Returns: 


<!-- ##### FUNCTION gtk_table_get_homogeneous ##### -->
<para>

</para>

@table: 
@Returns: 


<!-- ##### FUNCTION gtk_table_get_row_spacing ##### -->
<para>

</para>

@table: 
@row: 
@Returns: 


<!-- ##### FUNCTION gtk_table_get_col_spacing ##### -->
<para>

</para>

@table: 
@column: 
@Returns: 


<!-- ##### FUNCTION gtk_table_get_default_col_spacing ##### -->
<para>

</para>

@table: 
@Returns: 


<!-- ##### ARG GtkTable:column-spacing ##### -->
<para>
Sets or retrieves the number of pixels of space between columns.
</para>

<!-- ##### ARG GtkTable:homogeneous ##### -->
<para>
Whether each cell in the table should be the same size or not.
</para>

<!-- ##### ARG GtkTable:n-columns ##### -->
<para>
Sets or retrieves the number of columns in a table.
</para>

<!-- ##### ARG GtkTable:n-rows ##### -->
<para>
Sets or retrieves the number of rows in a table.
</para>

<!-- ##### ARG GtkTable:row-spacing ##### -->
<para>
Sets or retrieves the number of pixels of space between rows.
</para>

<!-- ##### ARG GtkTable:bottom-attach ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:left-attach ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:right-attach ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:top-attach ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:x-options ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:x-padding ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:y-options ##### -->
<para>

</para>

<!-- ##### ARG GtkTable:y-padding ##### -->
<para>

</para>