1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>GtkTable</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
8
<link rel="up" href="LayoutContainers.html" title="Layout Containers">
9
<link rel="prev" href="GtkNotebook.html" title="GtkNotebook">
10
<link rel="next" href="GtkExpander.html" title="GtkExpander">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="GtkNotebook.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="LayoutContainers.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
21
<td><a accesskey="n" href="GtkExpander.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#GtkTable.synopsis" class="shortcut">Top</a>
26
<a href="#GtkTable.description" class="shortcut">Description</a>
28
<a href="#GtkTable.object-hierarchy" class="shortcut">Object Hierarchy</a>
30
<a href="#GtkTable.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
32
<a href="#GtkTable.properties" class="shortcut">Properties</a>
34
<a href="#GtkTable.child-properties" class="shortcut">Child Properties</a>
37
<div class="refentry">
38
<a name="GtkTable"></a><div class="titlepage"></div>
39
<div class="refnamediv"><table width="100%"><tr>
41
<h2><span class="refentrytitle"><a name="GtkTable.top_of_page"></a>GtkTable</span></h2>
42
<p>GtkTable — Pack widgets in regular patterns</p>
44
<td valign="top" align="right"></td>
46
<div class="refsynopsisdiv">
47
<a name="GtkTable.synopsis"></a><h2>Synopsis</h2>
48
<pre class="synopsis">
49
#include <gtk/gtk.h>
51
struct <a class="link" href="GtkTable.html#GtkTable-struct" title="struct GtkTable">GtkTable</a>;
52
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkTable.html#gtk-table-new" title="gtk_table_new ()">gtk_table_new</a> (<em class="parameter"><code><span class="type">guint</span> rows</code></em>,
53
<em class="parameter"><code><span class="type">guint</span> columns</code></em>,
54
<em class="parameter"><code><span class="type">gboolean</span> homogeneous</code></em>);
55
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-resize" title="gtk_table_resize ()">gtk_table_resize</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
56
<em class="parameter"><code><span class="type">guint</span> rows</code></em>,
57
<em class="parameter"><code><span class="type">guint</span> columns</code></em>);
58
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-attach" title="gtk_table_attach ()">gtk_table_attach</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
59
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
60
<em class="parameter"><code><span class="type">guint</span> left_attach</code></em>,
61
<em class="parameter"><code><span class="type">guint</span> right_attach</code></em>,
62
<em class="parameter"><code><span class="type">guint</span> top_attach</code></em>,
63
<em class="parameter"><code><span class="type">guint</span> bottom_attach</code></em>,
64
<em class="parameter"><code><a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> xoptions</code></em>,
65
<em class="parameter"><code><a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> yoptions</code></em>,
66
<em class="parameter"><code><span class="type">guint</span> xpadding</code></em>,
67
<em class="parameter"><code><span class="type">guint</span> ypadding</code></em>);
68
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-attach-defaults" title="gtk_table_attach_defaults ()">gtk_table_attach_defaults</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
69
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
70
<em class="parameter"><code><span class="type">guint</span> left_attach</code></em>,
71
<em class="parameter"><code><span class="type">guint</span> right_attach</code></em>,
72
<em class="parameter"><code><span class="type">guint</span> top_attach</code></em>,
73
<em class="parameter"><code><span class="type">guint</span> bottom_attach</code></em>);
74
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-set-row-spacing" title="gtk_table_set_row_spacing ()">gtk_table_set_row_spacing</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
75
<em class="parameter"><code><span class="type">guint</span> row</code></em>,
76
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);
77
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-set-col-spacing" title="gtk_table_set_col_spacing ()">gtk_table_set_col_spacing</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
78
<em class="parameter"><code><span class="type">guint</span> column</code></em>,
79
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);
80
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-set-row-spacings" title="gtk_table_set_row_spacings ()">gtk_table_set_row_spacings</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
81
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);
82
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-set-col-spacings" title="gtk_table_set_col_spacings ()">gtk_table_set_col_spacings</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
83
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);
84
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-set-homogeneous" title="gtk_table_set_homogeneous ()">gtk_table_set_homogeneous</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
85
<em class="parameter"><code><span class="type">gboolean</span> homogeneous</code></em>);
86
<span class="returnvalue">guint</span> <a class="link" href="GtkTable.html#gtk-table-get-default-row-spacing" title="gtk_table_get_default_row_spacing ()">gtk_table_get_default_row_spacing</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>);
87
<span class="returnvalue">gboolean</span> <a class="link" href="GtkTable.html#gtk-table-get-homogeneous" title="gtk_table_get_homogeneous ()">gtk_table_get_homogeneous</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>);
88
<span class="returnvalue">guint</span> <a class="link" href="GtkTable.html#gtk-table-get-row-spacing" title="gtk_table_get_row_spacing ()">gtk_table_get_row_spacing</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
89
<em class="parameter"><code><span class="type">guint</span> row</code></em>);
90
<span class="returnvalue">guint</span> <a class="link" href="GtkTable.html#gtk-table-get-col-spacing" title="gtk_table_get_col_spacing ()">gtk_table_get_col_spacing</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
91
<em class="parameter"><code><span class="type">guint</span> column</code></em>);
92
<span class="returnvalue">guint</span> <a class="link" href="GtkTable.html#gtk-table-get-default-col-spacing" title="gtk_table_get_default_col_spacing ()">gtk_table_get_default_col_spacing</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>);
93
<span class="returnvalue">void</span> <a class="link" href="GtkTable.html#gtk-table-get-size" title="gtk_table_get_size ()">gtk_table_get_size</a> (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
94
<em class="parameter"><code><span class="type">guint</span> *rows</code></em>,
95
<em class="parameter"><code><span class="type">guint</span> *columns</code></em>);
98
<div class="refsect1">
99
<a name="GtkTable.object-hierarchy"></a><h2>Object Hierarchy</h2>
100
<pre class="synopsis">
102
+----GInitiallyUnowned
103
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
104
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
105
+----<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
109
<div class="refsect1">
110
<a name="GtkTable.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
113
AtkImplementorIface and <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
115
<div class="refsect1">
116
<a name="GtkTable.properties"></a><h2>Properties</h2>
117
<pre class="synopsis">
118
"<a class="link" href="GtkTable.html#GtkTable--column-spacing" title='The "column-spacing" property'>column-spacing</a>" <span class="type">guint</span> : Read / Write
119
"<a class="link" href="GtkTable.html#GtkTable--homogeneous" title='The "homogeneous" property'>homogeneous</a>" <span class="type">gboolean</span> : Read / Write
120
"<a class="link" href="GtkTable.html#GtkTable--n-columns" title='The "n-columns" property'>n-columns</a>" <span class="type">guint</span> : Read / Write
121
"<a class="link" href="GtkTable.html#GtkTable--n-rows" title='The "n-rows" property'>n-rows</a>" <span class="type">guint</span> : Read / Write
122
"<a class="link" href="GtkTable.html#GtkTable--row-spacing" title='The "row-spacing" property'>row-spacing</a>" <span class="type">guint</span> : Read / Write
125
<div class="refsect1">
126
<a name="GtkTable.child-properties"></a><h2>Child Properties</h2>
127
<pre class="synopsis">
128
"<a class="link" href="GtkTable.html#GtkTable--c-bottom-attach" title='The "bottom-attach" child property'>bottom-attach</a>" <span class="type">guint</span> : Read / Write
129
"<a class="link" href="GtkTable.html#GtkTable--c-left-attach" title='The "left-attach" child property'>left-attach</a>" <span class="type">guint</span> : Read / Write
130
"<a class="link" href="GtkTable.html#GtkTable--c-right-attach" title='The "right-attach" child property'>right-attach</a>" <span class="type">guint</span> : Read / Write
131
"<a class="link" href="GtkTable.html#GtkTable--c-top-attach" title='The "top-attach" child property'>top-attach</a>" <span class="type">guint</span> : Read / Write
132
"<a class="link" href="GtkTable.html#GtkTable--c-x-options" title='The "x-options" child property'>x-options</a>" <a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> : Read / Write
133
"<a class="link" href="GtkTable.html#GtkTable--c-x-padding" title='The "x-padding" child property'>x-padding</a>" <span class="type">guint</span> : Read / Write
134
"<a class="link" href="GtkTable.html#GtkTable--c-y-options" title='The "y-options" child property'>y-options</a>" <a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> : Read / Write
135
"<a class="link" href="GtkTable.html#GtkTable--c-y-padding" title='The "y-padding" child property'>y-padding</a>" <span class="type">guint</span> : Read / Write
138
<div class="refsect1">
139
<a name="GtkTable.description"></a><h2>Description</h2>
141
The <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> functions allow the programmer to arrange widgets in rows and
142
columns, making it easy to align many widgets next to each other,
143
horizontally and vertically.
146
Tables are created with a call to <a class="link" href="GtkTable.html#gtk-table-new" title="gtk_table_new ()"><code class="function">gtk_table_new()</code></a>, the size of which can
147
later be changed with <a class="link" href="GtkTable.html#gtk-table-resize" title="gtk_table_resize ()"><code class="function">gtk_table_resize()</code></a>.
150
Widgets can be added to a table using <a class="link" href="GtkTable.html#gtk-table-attach" title="gtk_table_attach ()"><code class="function">gtk_table_attach()</code></a> or the more
151
convenient (but slightly less flexible) <a class="link" href="GtkTable.html#gtk-table-attach-defaults" title="gtk_table_attach_defaults ()"><code class="function">gtk_table_attach_defaults()</code></a>.
154
To alter the space next to a specific row, use <a class="link" href="GtkTable.html#gtk-table-set-row-spacing" title="gtk_table_set_row_spacing ()"><code class="function">gtk_table_set_row_spacing()</code></a>,
155
and for a column, <a class="link" href="GtkTable.html#gtk-table-set-col-spacing" title="gtk_table_set_col_spacing ()"><code class="function">gtk_table_set_col_spacing()</code></a>.</p>
157
The gaps between <span class="emphasis"><em>all</em></span> rows or columns can be changed by calling
158
<a class="link" href="GtkTable.html#gtk-table-set-row-spacings" title="gtk_table_set_row_spacings ()"><code class="function">gtk_table_set_row_spacings()</code></a> or <a class="link" href="GtkTable.html#gtk-table-set-col-spacings" title="gtk_table_set_col_spacings ()"><code class="function">gtk_table_set_col_spacings()</code></a> respectively.
161
<a class="link" href="GtkTable.html#gtk-table-set-homogeneous" title="gtk_table_set_homogeneous ()"><code class="function">gtk_table_set_homogeneous()</code></a>, can be used to set whether all cells in the
162
table will resize themselves to the size of the largest widget in the table.
165
<div class="refsect1">
166
<a name="GtkTable.details"></a><h2>Details</h2>
167
<div class="refsect2">
168
<a name="GtkTable-struct"></a><h3>struct GtkTable</h3>
169
<pre class="programlisting">struct GtkTable;</pre>
171
The <span class="structname">GtkTable</span> structure holds the data for the actual table itself.
172
<em class="structfield"><code>children</code></em> is a <span class="type">GList</span> of all the widgets the table contains. <em class="structfield"><code>rows</code></em> and <em class="structfield"><code>columns</code></em> are pointers to <span class="type">GtkTableRowCol</span> structures, which contain the default spacing and expansion details for the <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>'s rows and columns, respectively.
175
<em class="structfield"><code>nrows</code></em> and <em class="structfield"><code>ncols</code></em> are 16bit integers storing the number of rows and columns the table has.
179
<div class="refsect2">
180
<a name="gtk-table-new"></a><h3>gtk_table_new ()</h3>
181
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_table_new (<em class="parameter"><code><span class="type">guint</span> rows</code></em>,
182
<em class="parameter"><code><span class="type">guint</span> columns</code></em>,
183
<em class="parameter"><code><span class="type">gboolean</span> homogeneous</code></em>);</pre>
185
Used to create a new table widget. An initial size must be given by
186
specifying how many rows and columns the table should have, although
187
this can be changed later with <a class="link" href="GtkTable.html#gtk-table-resize" title="gtk_table_resize ()"><code class="function">gtk_table_resize()</code></a>. <em class="parameter"><code>rows</code></em> and <em class="parameter"><code>columns</code></em>
188
must both be in the range 1 .. 65535. For historical reasons, 0 is accepted
189
as well and is silently interpreted as 1.
191
<div class="variablelist"><table border="0" class="variablelist">
193
<col align="left" valign="top">
198
<td><p><span class="term"><em class="parameter"><code>rows</code></em> :</span></p></td>
199
<td>The number of rows the new table should have.</td>
202
<td><p><span class="term"><em class="parameter"><code>columns</code></em> :</span></p></td>
203
<td>The number of columns the new table should have.</td>
206
<td><p><span class="term"><em class="parameter"><code>homogeneous</code></em> :</span></p></td>
207
<td>If set to <code class="literal">TRUE</code>, all table cells are resized to the size of the cell
208
containing the largest widget.</td>
211
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
212
<td>A pointer to the the newly created table widget.</td>
218
<div class="refsect2">
219
<a name="gtk-table-resize"></a><h3>gtk_table_resize ()</h3>
220
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_resize (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
221
<em class="parameter"><code><span class="type">guint</span> rows</code></em>,
222
<em class="parameter"><code><span class="type">guint</span> columns</code></em>);</pre>
224
If you need to change a table's size <span class="emphasis"><em>after</em></span> it has been created, this function allows you to do so.
226
<div class="variablelist"><table border="0" class="variablelist">
228
<col align="left" valign="top">
233
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
234
<td>The <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> you wish to change the size of.</td>
237
<td><p><span class="term"><em class="parameter"><code>rows</code></em> :</span></p></td>
238
<td>The new number of rows.</td>
241
<td><p><span class="term"><em class="parameter"><code>columns</code></em> :</span></p></td>
242
<td>The new number of columns.</td>
248
<div class="refsect2">
249
<a name="gtk-table-attach"></a><h3>gtk_table_attach ()</h3>
250
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_attach (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
251
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
252
<em class="parameter"><code><span class="type">guint</span> left_attach</code></em>,
253
<em class="parameter"><code><span class="type">guint</span> right_attach</code></em>,
254
<em class="parameter"><code><span class="type">guint</span> top_attach</code></em>,
255
<em class="parameter"><code><span class="type">guint</span> bottom_attach</code></em>,
256
<em class="parameter"><code><a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> xoptions</code></em>,
257
<em class="parameter"><code><a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> yoptions</code></em>,
258
<em class="parameter"><code><span class="type">guint</span> xpadding</code></em>,
259
<em class="parameter"><code><span class="type">guint</span> ypadding</code></em>);</pre>
261
Adds a widget to a table. The number of 'cells' that a widget will occupy is
262
specified by <em class="parameter"><code>left_attach</code></em>, <em class="parameter"><code>right_attach</code></em>, <em class="parameter"><code>top_attach</code></em> and <em class="parameter"><code>bottom_attach</code></em>.
263
These each represent the leftmost, rightmost, uppermost and lowest column
264
and row numbers of the table. (Columns and rows are indexed from zero).
266
<div class="variablelist"><table border="0" class="variablelist">
268
<col align="left" valign="top">
273
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
274
<td>The <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> to add a new widget to.</td>
277
<td><p><span class="term"><em class="parameter"><code>child</code></em> :</span></p></td>
278
<td>The widget to add.</td>
281
<td><p><span class="term"><em class="parameter"><code>left_attach</code></em> :</span></p></td>
282
<td>the column number to attach the left side of a child widget to.</td>
285
<td><p><span class="term"><em class="parameter"><code>right_attach</code></em> :</span></p></td>
286
<td>the column number to attach the right side of a child widget to.</td>
289
<td><p><span class="term"><em class="parameter"><code>top_attach</code></em> :</span></p></td>
290
<td>the row number to attach the top of a child widget to.</td>
293
<td><p><span class="term"><em class="parameter"><code>bottom_attach</code></em> :</span></p></td>
294
<td>the row number to attach the bottom of a child widget to.</td>
297
<td><p><span class="term"><em class="parameter"><code>xoptions</code></em> :</span></p></td>
298
<td>Used to specify the properties of the child widget when the table is resized.</td>
301
<td><p><span class="term"><em class="parameter"><code>yoptions</code></em> :</span></p></td>
302
<td>The same as xoptions, except this field determines behaviour of vertical resizing.</td>
305
<td><p><span class="term"><em class="parameter"><code>xpadding</code></em> :</span></p></td>
306
<td>An integer value specifying the padding on the left and right of the widget being added to the table.</td>
309
<td><p><span class="term"><em class="parameter"><code>ypadding</code></em> :</span></p></td>
310
<td>The amount of padding above and below the child widget.</td>
316
<div class="refsect2">
317
<a name="gtk-table-attach-defaults"></a><h3>gtk_table_attach_defaults ()</h3>
318
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_attach_defaults (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
319
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
320
<em class="parameter"><code><span class="type">guint</span> left_attach</code></em>,
321
<em class="parameter"><code><span class="type">guint</span> right_attach</code></em>,
322
<em class="parameter"><code><span class="type">guint</span> top_attach</code></em>,
323
<em class="parameter"><code><span class="type">guint</span> bottom_attach</code></em>);</pre>
325
As there are many options associated with <a class="link" href="GtkTable.html#gtk-table-attach" title="gtk_table_attach ()"><code class="function">gtk_table_attach()</code></a>, this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options. The values used for the <a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> are <code class="literal">GTK_EXPAND | GTK_FILL</code>, and the padding is set to 0.
327
<div class="variablelist"><table border="0" class="variablelist">
329
<col align="left" valign="top">
334
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
335
<td>The table to add a new child widget to.</td>
338
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
339
<td>The child widget to add.</td>
342
<td><p><span class="term"><em class="parameter"><code>left_attach</code></em> :</span></p></td>
343
<td>The column number to attach the left side of the child widget to.</td>
346
<td><p><span class="term"><em class="parameter"><code>right_attach</code></em> :</span></p></td>
347
<td>The column number to attach the right side of the child widget to.</td>
350
<td><p><span class="term"><em class="parameter"><code>top_attach</code></em> :</span></p></td>
351
<td>The row number to attach the top of the child widget to.</td>
354
<td><p><span class="term"><em class="parameter"><code>bottom_attach</code></em> :</span></p></td>
355
<td>The row number to attach the bottom of the child widget to.</td>
361
<div class="refsect2">
362
<a name="gtk-table-set-row-spacing"></a><h3>gtk_table_set_row_spacing ()</h3>
363
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_set_row_spacing (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
364
<em class="parameter"><code><span class="type">guint</span> row</code></em>,
365
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);</pre>
367
Changes the space between a given table row and the subsequent row.
369
<div class="variablelist"><table border="0" class="variablelist">
371
<col align="left" valign="top">
376
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
377
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> containing the row whose properties you wish to change.</td>
380
<td><p><span class="term"><em class="parameter"><code>row</code></em> :</span></p></td>
381
<td>row number whose spacing will be changed.</td>
384
<td><p><span class="term"><em class="parameter"><code>spacing</code></em> :</span></p></td>
385
<td>number of pixels that the spacing should take up.</td>
391
<div class="refsect2">
392
<a name="gtk-table-set-col-spacing"></a><h3>gtk_table_set_col_spacing ()</h3>
393
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_set_col_spacing (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
394
<em class="parameter"><code><span class="type">guint</span> column</code></em>,
395
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);</pre>
397
Alters the amount of space between a given table column and the following
400
<div class="variablelist"><table border="0" class="variablelist">
402
<col align="left" valign="top">
407
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
408
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>.</td>
411
<td><p><span class="term"><em class="parameter"><code>column</code></em> :</span></p></td>
412
<td>the column whose spacing should be changed.</td>
415
<td><p><span class="term"><em class="parameter"><code>spacing</code></em> :</span></p></td>
416
<td>number of pixels that the spacing should take up.</td>
422
<div class="refsect2">
423
<a name="gtk-table-set-row-spacings"></a><h3>gtk_table_set_row_spacings ()</h3>
424
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_set_row_spacings (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
425
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);</pre>
427
Sets the space between every row in <em class="parameter"><code>table</code></em> equal to <em class="parameter"><code>spacing</code></em>.
429
<div class="variablelist"><table border="0" class="variablelist">
431
<col align="left" valign="top">
436
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
437
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>.</td>
440
<td><p><span class="term"><em class="parameter"><code>spacing</code></em> :</span></p></td>
441
<td>the number of pixels of space to place between every row in the table.</td>
447
<div class="refsect2">
448
<a name="gtk-table-set-col-spacings"></a><h3>gtk_table_set_col_spacings ()</h3>
449
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_set_col_spacings (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
450
<em class="parameter"><code><span class="type">guint</span> spacing</code></em>);</pre>
452
Sets the space between every column in <em class="parameter"><code>table</code></em> equal to <em class="parameter"><code>spacing</code></em>.
454
<div class="variablelist"><table border="0" class="variablelist">
456
<col align="left" valign="top">
461
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
462
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>.</td>
465
<td><p><span class="term"><em class="parameter"><code>spacing</code></em> :</span></p></td>
466
<td>the number of pixels of space to place between every column in the table.</td>
472
<div class="refsect2">
473
<a name="gtk-table-set-homogeneous"></a><h3>gtk_table_set_homogeneous ()</h3>
474
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_set_homogeneous (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
475
<em class="parameter"><code><span class="type">gboolean</span> homogeneous</code></em>);</pre>
477
Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.
479
<div class="variablelist"><table border="0" class="variablelist">
481
<col align="left" valign="top">
486
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
487
<td>The <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> you wish to set the homogeneous properties of.</td>
490
<td><p><span class="term"><em class="parameter"><code>homogeneous</code></em> :</span></p></td>
491
<td>Set to <code class="literal">TRUE</code> to ensure all table cells are the same size. Set
492
to <code class="literal">FALSE</code> if this is not your desired behaviour.</td>
498
<div class="refsect2">
499
<a name="gtk-table-get-default-row-spacing"></a><h3>gtk_table_get_default_row_spacing ()</h3>
500
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_table_get_default_row_spacing (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>);</pre>
502
Gets the default row spacing for the table. This is
503
the spacing that will be used for newly added rows.
504
(See <a class="link" href="GtkTable.html#gtk-table-set-row-spacings" title="gtk_table_set_row_spacings ()"><code class="function">gtk_table_set_row_spacings()</code></a>)
506
<div class="variablelist"><table border="0" class="variablelist">
508
<col align="left" valign="top">
513
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
514
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>
518
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
519
<td>the default row spacing</td>
525
<div class="refsect2">
526
<a name="gtk-table-get-homogeneous"></a><h3>gtk_table_get_homogeneous ()</h3>
527
<pre class="programlisting"><span class="returnvalue">gboolean</span> gtk_table_get_homogeneous (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>);</pre>
529
Returns whether the table cells are all constrained to the same
530
width and height. (See <code class="function">gtk_table_set_homogenous()</code>)
532
<div class="variablelist"><table border="0" class="variablelist">
534
<col align="left" valign="top">
539
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
540
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>
544
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
546
<code class="literal">TRUE</code> if the cells are all constrained to the same size</td>
552
<div class="refsect2">
553
<a name="gtk-table-get-row-spacing"></a><h3>gtk_table_get_row_spacing ()</h3>
554
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_table_get_row_spacing (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
555
<em class="parameter"><code><span class="type">guint</span> row</code></em>);</pre>
557
Gets the amount of space between row <em class="parameter"><code>row</code></em>, and
558
row <em class="parameter"><code>row</code></em> + 1. See <a class="link" href="GtkTable.html#gtk-table-set-row-spacing" title="gtk_table_set_row_spacing ()"><code class="function">gtk_table_set_row_spacing()</code></a>.
560
<div class="variablelist"><table border="0" class="variablelist">
562
<col align="left" valign="top">
567
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
568
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>
572
<td><p><span class="term"><em class="parameter"><code>row</code></em> :</span></p></td>
573
<td>a row in the table, 0 indicates the first row</td>
576
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
577
<td>the row spacing</td>
583
<div class="refsect2">
584
<a name="gtk-table-get-col-spacing"></a><h3>gtk_table_get_col_spacing ()</h3>
585
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_table_get_col_spacing (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
586
<em class="parameter"><code><span class="type">guint</span> column</code></em>);</pre>
588
Gets the amount of space between column <em class="parameter"><code>col</code></em>, and
589
column <em class="parameter"><code>col</code></em> + 1. See <a class="link" href="GtkTable.html#gtk-table-set-col-spacing" title="gtk_table_set_col_spacing ()"><code class="function">gtk_table_set_col_spacing()</code></a>.
591
<div class="variablelist"><table border="0" class="variablelist">
593
<col align="left" valign="top">
598
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
599
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>
603
<td><p><span class="term"><em class="parameter"><code>column</code></em> :</span></p></td>
604
<td>a column in the table, 0 indicates the first column</td>
607
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
608
<td>the column spacing</td>
614
<div class="refsect2">
615
<a name="gtk-table-get-default-col-spacing"></a><h3>gtk_table_get_default_col_spacing ()</h3>
616
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_table_get_default_col_spacing (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>);</pre>
618
Gets the default column spacing for the table. This is
619
the spacing that will be used for newly added columns.
620
(See <a class="link" href="GtkTable.html#gtk-table-set-col-spacings" title="gtk_table_set_col_spacings ()"><code class="function">gtk_table_set_col_spacings()</code></a>)
622
<div class="variablelist"><table border="0" class="variablelist">
624
<col align="left" valign="top">
629
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
630
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>
634
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
635
<td>the default column spacing</td>
641
<div class="refsect2">
642
<a name="gtk-table-get-size"></a><h3>gtk_table_get_size ()</h3>
643
<pre class="programlisting"><span class="returnvalue">void</span> gtk_table_get_size (<em class="parameter"><code><a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> *table</code></em>,
644
<em class="parameter"><code><span class="type">guint</span> *rows</code></em>,
645
<em class="parameter"><code><span class="type">guint</span> *columns</code></em>);</pre>
646
<div class="variablelist"><table border="0" class="variablelist">
648
<col align="left" valign="top">
653
<td><p><span class="term"><em class="parameter"><code>table</code></em> :</span></p></td>
654
<td>a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>
658
<td><p><span class="term"><em class="parameter"><code>rows</code></em> :</span></p></td>
659
<td>return location for the number of
660
rows, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
664
<td><p><span class="term"><em class="parameter"><code>columns</code></em> :</span></p></td>
665
<td>return location for the number
666
of columns, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
671
<p class="since">Since 2.22</p>
674
<div class="refsect1">
675
<a name="GtkTable.property-details"></a><h2>Property Details</h2>
676
<div class="refsect2">
677
<a name="GtkTable--column-spacing"></a><h3>The <code class="literal">"column-spacing"</code> property</h3>
678
<pre class="programlisting"> "column-spacing" <span class="type">guint</span> : Read / Write</pre>
679
<p>The amount of space between two consecutive columns.</p>
680
<p>Allowed values: <= 65535</p>
681
<p>Default value: 0</p>
684
<div class="refsect2">
685
<a name="GtkTable--homogeneous"></a><h3>The <code class="literal">"homogeneous"</code> property</h3>
686
<pre class="programlisting"> "homogeneous" <span class="type">gboolean</span> : Read / Write</pre>
687
<p>If TRUE, the table cells are all the same width/height.</p>
688
<p>Default value: FALSE</p>
691
<div class="refsect2">
692
<a name="GtkTable--n-columns"></a><h3>The <code class="literal">"n-columns"</code> property</h3>
693
<pre class="programlisting"> "n-columns" <span class="type">guint</span> : Read / Write</pre>
694
<p>The number of columns in the table.</p>
695
<p>Allowed values: [1,65535]</p>
696
<p>Default value: 1</p>
699
<div class="refsect2">
700
<a name="GtkTable--n-rows"></a><h3>The <code class="literal">"n-rows"</code> property</h3>
701
<pre class="programlisting"> "n-rows" <span class="type">guint</span> : Read / Write</pre>
702
<p>The number of rows in the table.</p>
703
<p>Allowed values: [1,65535]</p>
704
<p>Default value: 1</p>
707
<div class="refsect2">
708
<a name="GtkTable--row-spacing"></a><h3>The <code class="literal">"row-spacing"</code> property</h3>
709
<pre class="programlisting"> "row-spacing" <span class="type">guint</span> : Read / Write</pre>
710
<p>The amount of space between two consecutive rows.</p>
711
<p>Allowed values: <= 65535</p>
712
<p>Default value: 0</p>
715
<div class="refsect1">
716
<a name="GtkTable.child-property-details"></a><h2>Child Property Details</h2>
717
<div class="refsect2">
718
<a name="GtkTable--c-bottom-attach"></a><h3>The <code class="literal">"bottom-attach"</code> child property</h3>
719
<pre class="programlisting"> "bottom-attach" <span class="type">guint</span> : Read / Write</pre>
720
<p>The row number to attach the bottom of the child to.</p>
721
<p>Allowed values: [1,65535]</p>
722
<p>Default value: 1</p>
725
<div class="refsect2">
726
<a name="GtkTable--c-left-attach"></a><h3>The <code class="literal">"left-attach"</code> child property</h3>
727
<pre class="programlisting"> "left-attach" <span class="type">guint</span> : Read / Write</pre>
728
<p>The column number to attach the left side of the child to.</p>
729
<p>Allowed values: <= 65535</p>
730
<p>Default value: 0</p>
733
<div class="refsect2">
734
<a name="GtkTable--c-right-attach"></a><h3>The <code class="literal">"right-attach"</code> child property</h3>
735
<pre class="programlisting"> "right-attach" <span class="type">guint</span> : Read / Write</pre>
736
<p>The column number to attach the right side of a child widget to.</p>
737
<p>Allowed values: [1,65535]</p>
738
<p>Default value: 1</p>
741
<div class="refsect2">
742
<a name="GtkTable--c-top-attach"></a><h3>The <code class="literal">"top-attach"</code> child property</h3>
743
<pre class="programlisting"> "top-attach" <span class="type">guint</span> : Read / Write</pre>
744
<p>The row number to attach the top of a child widget to.</p>
745
<p>Allowed values: <= 65535</p>
746
<p>Default value: 0</p>
749
<div class="refsect2">
750
<a name="GtkTable--c-x-options"></a><h3>The <code class="literal">"x-options"</code> child property</h3>
751
<pre class="programlisting"> "x-options" <a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> : Read / Write</pre>
752
<p>Options specifying the horizontal behaviour of the child.</p>
753
<p>Default value: GTK_EXPAND|GTK_FILL</p>
756
<div class="refsect2">
757
<a name="GtkTable--c-x-padding"></a><h3>The <code class="literal">"x-padding"</code> child property</h3>
758
<pre class="programlisting"> "x-padding" <span class="type">guint</span> : Read / Write</pre>
759
<p>Extra space to put between the child and its left and right neighbors, in pixels.</p>
760
<p>Allowed values: <= 65535</p>
761
<p>Default value: 0</p>
764
<div class="refsect2">
765
<a name="GtkTable--c-y-options"></a><h3>The <code class="literal">"y-options"</code> child property</h3>
766
<pre class="programlisting"> "y-options" <a class="link" href="gtk2-Standard-Enumerations.html#GtkAttachOptions" title="enum GtkAttachOptions"><span class="type">GtkAttachOptions</span></a> : Read / Write</pre>
767
<p>Options specifying the vertical behaviour of the child.</p>
768
<p>Default value: GTK_EXPAND|GTK_FILL</p>
771
<div class="refsect2">
772
<a name="GtkTable--c-y-padding"></a><h3>The <code class="literal">"y-padding"</code> child property</h3>
773
<pre class="programlisting"> "y-padding" <span class="type">guint</span> : Read / Write</pre>
774
<p>Extra space to put between the child and its upper and lower neighbors, in pixels.</p>
775
<p>Allowed values: <= 65535</p>
776
<p>Default value: 0</p>
779
<div class="refsect1">
780
<a name="GtkTable.see-also"></a><h2>See Also</h2>
783
<div class="variablelist"><table border="0" class="variablelist">
785
<col align="left" valign="top">
790
<td><p><span class="term"><a class="link" href="GtkVBox.html" title="GtkVBox"><span class="type">GtkVBox</span></a></span></p></td>
791
<td><p>For packing widgets vertically only.</p></td>
794
<td><p><span class="term"><a class="link" href="GtkHBox.html" title="GtkHBox"><span class="type">GtkHBox</span></a></span></p></td>
795
<td><p>For packing widgets horizontally only.</p></td>
805
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'