1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
<title>GtkAlignment</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
7
<link rel="start" href="index.html" title="GTK+ Reference Manual">
8
<link rel="up" href="LayoutContainers.html" title="Layout Containers">
9
<link rel="prev" href="LayoutContainers.html" title="Layout Containers">
10
<link rel="next" href="GtkAspectFrame.html" title="GtkAspectFrame">
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
14
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
15
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
16
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
17
<link rel="chapter" href="ch02.html" title="Widget Gallery">
18
<link rel="chapter" href="WindowWidgets.html" title="Windows">
19
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
20
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
21
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
22
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
23
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
24
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
25
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
26
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
27
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
28
<link rel="chapter" href="Ornaments.html" title="Ornaments">
29
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
30
<link rel="chapter" href="Printing.html" title="Printing">
31
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
32
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
33
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
34
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
35
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
36
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
37
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
38
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
39
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
40
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
41
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
42
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
43
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
44
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
45
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
46
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
47
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
48
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
49
<link rel="glossary" href="glossary.html" title="Glossary">
50
<link rel="index" href="ix01.html" title="Index">
51
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
52
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
53
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
54
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
55
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
56
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
58
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
59
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
61
<td><a accesskey="p" href="LayoutContainers.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
62
<td><a accesskey="u" href="LayoutContainers.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
63
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
64
<th width="100%" align="center">GTK+ Reference Manual</th>
65
<td><a accesskey="n" href="GtkAspectFrame.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
67
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3511357" class="shortcut">Top</a>
69
<a href="#id3511832" class="shortcut">Description</a>
71
<a href="#id3511591" class="shortcut">Object Hierarchy</a>
73
<a href="#id3511652" class="shortcut">Implemented Interfaces</a>
75
<a href="#id3511675" class="shortcut">Properties</a></nobr></td></tr>
77
<div class="refentry" lang="en">
78
<a name="GtkAlignment"></a><div class="titlepage"></div>
79
<div class="refnamediv"><table width="100%"><tr>
82
<a name="id3511357"></a><span class="refentrytitle">GtkAlignment</span>
84
<p>GtkAlignment — A widget which controls the alignment and size of its child</p>
86
<td valign="top" align="right"></td>
88
<div class="refsynopsisdiv">
90
<pre class="synopsis">
92
#include <gtk/gtk.h>
95
<a href="GtkAlignment.html#GtkAlignment-struct">GtkAlignment</a>;
96
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkAlignment.html#gtk-alignment-new">gtk_alignment_new</a> (gfloat xalign,
100
void <a href="GtkAlignment.html#gtk-alignment-set">gtk_alignment_set</a> (<a href="GtkAlignment.html" title="GtkAlignment">GtkAlignment</a> *alignment,
105
void <a href="GtkAlignment.html#gtk-alignment-get-padding">gtk_alignment_get_padding</a> (<a href="GtkAlignment.html" title="GtkAlignment">GtkAlignment</a> *alignment,
107
guint *padding_bottom,
109
guint *padding_right);
110
void <a href="GtkAlignment.html#gtk-alignment-set-padding">gtk_alignment_set_padding</a> (<a href="GtkAlignment.html" title="GtkAlignment">GtkAlignment</a> *alignment,
112
guint padding_bottom,
114
guint padding_right);
119
<div class="refsect1" lang="en">
120
<a name="id3511591"></a><h2>Object Hierarchy</h2>
121
<pre class="synopsis">
124
+----GInitiallyUnowned
125
+----<a href="GtkObject.html" title="GtkObject">GtkObject</a>
126
+----<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
127
+----<a href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
128
+----<a href="GtkBin.html" title="GtkBin">GtkBin</a>
132
<div class="refsect1" lang="en">
133
<a name="id3511652"></a><h2>Implemented Interfaces</h2>
135
GtkAlignment implements
136
AtkImplementorIface.</p>
138
<div class="refsect1" lang="en">
139
<a name="id3511675"></a><h2>Properties</h2>
140
<pre class="synopsis">
142
"<a href="GtkAlignment.html#GtkAlignment--bottom-padding">bottom-padding</a>" guint : Read / Write
143
"<a href="GtkAlignment.html#GtkAlignment--left-padding">left-padding</a>" guint : Read / Write
144
"<a href="GtkAlignment.html#GtkAlignment--right-padding">right-padding</a>" guint : Read / Write
145
"<a href="GtkAlignment.html#GtkAlignment--top-padding">top-padding</a>" guint : Read / Write
146
"<a href="GtkAlignment.html#GtkAlignment--xalign">xalign</a>" gfloat : Read / Write
147
"<a href="GtkAlignment.html#GtkAlignment--xscale">xscale</a>" gfloat : Read / Write
148
"<a href="GtkAlignment.html#GtkAlignment--yalign">yalign</a>" gfloat : Read / Write
149
"<a href="GtkAlignment.html#GtkAlignment--yscale">yscale</a>" gfloat : Read / Write
152
<div class="refsect1" lang="en">
153
<a name="id3511832"></a><h2>Description</h2>
155
The <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a> widget controls the alignment and size of its child widget.
156
It has four settings: xscale, yscale, xalign, and yalign.
159
The scale settings are used to specify how much the child widget should
160
expand to fill the space allocated to the <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>.
161
The values can range from 0 (meaning the child doesn't expand at all) to
162
1 (meaning the child expands to fill all of the available space).
165
The align settings are used to place the child widget within the available
166
area. The values range from 0 (top or left) to 1 (bottom or right).
167
Of course, if the scale settings are both set to 1, the alignment settings
171
<div class="refsect1" lang="en">
172
<a name="id3511880"></a><h2>Details</h2>
173
<div class="refsect2" lang="en">
174
<a name="id3511890"></a><h3>
175
<a name="GtkAlignment-struct"></a>GtkAlignment</h3>
176
<a class="indexterm" name="id3511902"></a><pre class="programlisting">typedef struct _GtkAlignment GtkAlignment;</pre>
178
The <a href="GtkAlignment.html#GtkAlignment-struct"><span class="type">GtkAlignment</span></a> struct contains private data only, and should
179
be accessed using the functions below.
183
<div class="refsect2" lang="en">
184
<a name="id3511928"></a><h3>
185
<a name="gtk-alignment-new"></a>gtk_alignment_new ()</h3>
186
<a class="indexterm" name="id3511941"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_alignment_new (gfloat xalign,
189
gfloat yscale);</pre>
191
Creates a new <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>.
193
<div class="variablelist"><table border="0">
194
<col align="left" valign="top">
197
<td><span class="term"><em class="parameter"><code>xalign</code></em> :</span></td>
198
<td>the horizontal alignment of the child widget, from 0 (left) to 1
203
<td><span class="term"><em class="parameter"><code>yalign</code></em> :</span></td>
204
<td>the vertical alignment of the child widget, from 0 (top) to 1
209
<td><span class="term"><em class="parameter"><code>xscale</code></em> :</span></td>
210
<td>the amount that the child widget expands horizontally to fill up
211
unused space, from 0 to 1.
212
A value of 0 indicates that the child widget should never expand.
213
A value of 1 indicates that the child widget will expand to fill all of the
214
space allocated for the <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>.
218
<td><span class="term"><em class="parameter"><code>yscale</code></em> :</span></td>
219
<td>the amount that the child widget expands vertically to fill up
220
unused space, from 0 to 1. The values are similar to <em class="parameter"><code>xscale</code></em>.
224
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
225
<td>the new <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>.
234
<div class="refsect2" lang="en">
235
<a name="id3512101"></a><h3>
236
<a name="gtk-alignment-set"></a>gtk_alignment_set ()</h3>
237
<a class="indexterm" name="id3512115"></a><pre class="programlisting">void gtk_alignment_set (<a href="GtkAlignment.html" title="GtkAlignment">GtkAlignment</a> *alignment,
241
gfloat yscale);</pre>
243
Sets the <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a> values.
245
<div class="variablelist"><table border="0">
246
<col align="left" valign="top">
249
<td><span class="term"><em class="parameter"><code>alignment</code></em> :</span></td>
250
<td>a <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>.
254
<td><span class="term"><em class="parameter"><code>xalign</code></em> :</span></td>
255
<td>the horizontal alignment of the child widget, from 0 (left) to 1
260
<td><span class="term"><em class="parameter"><code>yalign</code></em> :</span></td>
261
<td>the vertical alignment of the child widget, from 0 (top) to 1
266
<td><span class="term"><em class="parameter"><code>xscale</code></em> :</span></td>
267
<td>the amount that the child widget expands horizontally to fill up
268
unused space, from 0 to 1.
269
A value of 0 indicates that the child widget should never expand.
270
A value of 1 indicates that the child widget will expand to fill all of the
271
space allocated for the <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>.
275
<td><span class="term"><em class="parameter"><code>yscale</code></em> :</span></td>
276
<td>the amount that the child widget expands vertically to fill up
277
unused space, from 0 to 1. The values are similar to <em class="parameter"><code>xscale</code></em>.
286
<div class="refsect2" lang="en">
287
<a name="id3512286"></a><h3>
288
<a name="gtk-alignment-get-padding"></a>gtk_alignment_get_padding ()</h3>
289
<a class="indexterm" name="id3512303"></a><pre class="programlisting">void gtk_alignment_get_padding (<a href="GtkAlignment.html" title="GtkAlignment">GtkAlignment</a> *alignment,
291
guint *padding_bottom,
293
guint *padding_right);</pre>
295
Gets the padding on the different sides of the widget.
296
See <a href="GtkAlignment.html#gtk-alignment-set-padding"><code class="function">gtk_alignment_set_padding()</code></a>.</p>
300
<div class="variablelist"><table border="0">
301
<col align="left" valign="top">
304
<td><span class="term"><em class="parameter"><code>alignment</code></em> :</span></td>
305
<td> a <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>
309
<td><span class="term"><em class="parameter"><code>padding_top</code></em> :</span></td>
310
<td> location to store the padding for the top of the widget, or <a
311
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
312
><code class="literal">NULL</code></a>
316
<td><span class="term"><em class="parameter"><code>padding_bottom</code></em> :</span></td>
317
<td> location to store the padding for the bottom of the widget, or <a
318
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
319
><code class="literal">NULL</code></a>
323
<td><span class="term"><em class="parameter"><code>padding_left</code></em> :</span></td>
324
<td> location to store the padding for the left of the widget, or <a
325
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
326
><code class="literal">NULL</code></a>
330
<td><span class="term"><em class="parameter"><code>padding_right</code></em> :</span></td>
331
<td> location to store the padding for the right of the widget, or <a
332
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
333
><code class="literal">NULL</code></a>
338
<p class="since">Since 2.4
342
<div class="refsect2" lang="en">
343
<a name="id3512510"></a><h3>
344
<a name="gtk-alignment-set-padding"></a>gtk_alignment_set_padding ()</h3>
345
<a class="indexterm" name="id3512526"></a><pre class="programlisting">void gtk_alignment_set_padding (<a href="GtkAlignment.html" title="GtkAlignment">GtkAlignment</a> *alignment,
347
guint padding_bottom,
349
guint padding_right);</pre>
351
Sets the padding on the different sides of the widget.
352
The padding adds blank space to the sides of the widget. For instance,
353
this can be used to indent the child widget towards the right by adding
354
padding on the left.</p>
358
<div class="variablelist"><table border="0">
359
<col align="left" valign="top">
362
<td><span class="term"><em class="parameter"><code>alignment</code></em> :</span></td>
363
<td> a <a href="GtkAlignment.html" title="GtkAlignment"><span class="type">GtkAlignment</span></a>
367
<td><span class="term"><em class="parameter"><code>padding_top</code></em> :</span></td>
368
<td> the padding at the top of the widget
372
<td><span class="term"><em class="parameter"><code>padding_bottom</code></em> :</span></td>
373
<td> the padding at the bottom of the widget
377
<td><span class="term"><em class="parameter"><code>padding_left</code></em> :</span></td>
378
<td> the padding at the left of the widget
382
<td><span class="term"><em class="parameter"><code>padding_right</code></em> :</span></td>
383
<td> the padding at the right of the widget.
388
<p class="since">Since 2.4
392
<div class="refsect1" lang="en">
393
<a name="id3512685"></a><h2>Property Details</h2>
394
<div class="refsect2" lang="en">
395
<a name="id3512696"></a><h3>
396
<a name="GtkAlignment--bottom-padding"></a>The "<code class="literal">bottom-padding</code>" property</h3>
397
<a class="indexterm" name="id3512713"></a><pre class="programlisting"> "bottom-padding" guint : Read / Write</pre>
399
The padding to insert at the bottom of the widget.</p>
403
<p>Allowed values: <= G_MAXINT</p>
404
<p>Default value: 0</p>
409
<div class="refsect2" lang="en">
410
<a name="id3512752"></a><h3>
411
<a name="GtkAlignment--left-padding"></a>The "<code class="literal">left-padding</code>" property</h3>
412
<a class="indexterm" name="id3512769"></a><pre class="programlisting"> "left-padding" guint : Read / Write</pre>
414
The padding to insert at the left of the widget.</p>
418
<p>Allowed values: <= G_MAXINT</p>
419
<p>Default value: 0</p>
424
<div class="refsect2" lang="en">
425
<a name="id3512808"></a><h3>
426
<a name="GtkAlignment--right-padding"></a>The "<code class="literal">right-padding</code>" property</h3>
427
<a class="indexterm" name="id3512825"></a><pre class="programlisting"> "right-padding" guint : Read / Write</pre>
429
The padding to insert at the right of the widget.</p>
433
<p>Allowed values: <= G_MAXINT</p>
434
<p>Default value: 0</p>
439
<div class="refsect2" lang="en">
440
<a name="id3512864"></a><h3>
441
<a name="GtkAlignment--top-padding"></a>The "<code class="literal">top-padding</code>" property</h3>
442
<a class="indexterm" name="id3512881"></a><pre class="programlisting"> "top-padding" guint : Read / Write</pre>
444
The padding to insert at the top of the widget.</p>
448
<p>Allowed values: <= G_MAXINT</p>
449
<p>Default value: 0</p>
454
<div class="refsect2" lang="en">
455
<a name="id3512920"></a><h3>
456
<a name="GtkAlignment--xalign"></a>The "<code class="literal">xalign</code>" property</h3>
457
<a class="indexterm" name="id3512937"></a><pre class="programlisting"> "xalign" gfloat : Read / Write</pre>
458
<p>Horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned.</p>
459
<p>Allowed values: [0,1]</p>
460
<p>Default value: 0.5</p>
463
<div class="refsect2" lang="en">
464
<a name="id3512969"></a><h3>
465
<a name="GtkAlignment--xscale"></a>The "<code class="literal">xscale</code>" property</h3>
466
<a class="indexterm" name="id3512985"></a><pre class="programlisting"> "xscale" gfloat : Read / Write</pre>
467
<p>If available horizontal space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all.</p>
468
<p>Allowed values: [0,1]</p>
469
<p>Default value: 1</p>
472
<div class="refsect2" lang="en">
473
<a name="id3513018"></a><h3>
474
<a name="GtkAlignment--yalign"></a>The "<code class="literal">yalign</code>" property</h3>
475
<a class="indexterm" name="id3513035"></a><pre class="programlisting"> "yalign" gfloat : Read / Write</pre>
476
<p>Vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned.</p>
477
<p>Allowed values: [0,1]</p>
478
<p>Default value: 0.5</p>
481
<div class="refsect2" lang="en">
482
<a name="id3513067"></a><h3>
483
<a name="GtkAlignment--yscale"></a>The "<code class="literal">yscale</code>" property</h3>
484
<a class="indexterm" name="id3513084"></a><pre class="programlisting"> "yscale" gfloat : Read / Write</pre>
485
<p>If available vertical space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all.</p>
486
<p>Allowed values: [0,1]</p>
487
<p>Default value: 1</p>