<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkAlignment">
<refmeta>
<refentrytitle role="top_of_page" id="GtkAlignment.top_of_page">GtkAlignment</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkAlignment</refname>
<refpurpose>A widget which controls the alignment and size of its child</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkAlignment.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkAlignment-struct">GtkAlignment</link>;
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-alignment-new">gtk_alignment_new</link>                   (<link linkend="gfloat">gfloat</link> xalign,
                                                         <link linkend="gfloat">gfloat</link> yalign,
                                                         <link linkend="gfloat">gfloat</link> xscale,
                                                         <link linkend="gfloat">gfloat</link> yscale);
<link linkend="void">void</link>                <link linkend="gtk-alignment-set">gtk_alignment_set</link>                   (<link linkend="GtkAlignment">GtkAlignment</link> *alignment,
                                                         <link linkend="gfloat">gfloat</link> xalign,
                                                         <link linkend="gfloat">gfloat</link> yalign,
                                                         <link linkend="gfloat">gfloat</link> xscale,
                                                         <link linkend="gfloat">gfloat</link> yscale);
<link linkend="void">void</link>                <link linkend="gtk-alignment-get-padding">gtk_alignment_get_padding</link>           (<link linkend="GtkAlignment">GtkAlignment</link> *alignment,
                                                         <link linkend="guint">guint</link> *padding_top,
                                                         <link linkend="guint">guint</link> *padding_bottom,
                                                         <link linkend="guint">guint</link> *padding_left,
                                                         <link linkend="guint">guint</link> *padding_right);
<link linkend="void">void</link>                <link linkend="gtk-alignment-set-padding">gtk_alignment_set_padding</link>           (<link linkend="GtkAlignment">GtkAlignment</link> *alignment,
                                                         <link linkend="guint">guint</link> padding_top,
                                                         <link linkend="guint">guint</link> padding_bottom,
                                                         <link linkend="guint">guint</link> padding_left,
                                                         <link linkend="guint">guint</link> padding_right);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkAlignment.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBin">GtkBin</link>
                                 +----GtkAlignment
</synopsis>
</refsect1>



<refsect1 id="GtkAlignment.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkAlignment implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
</refsect1>


<refsect1 id="GtkAlignment.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkAlignment--bottom-padding">bottom-padding</link>&quot;           <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkAlignment--left-padding">left-padding</link>&quot;             <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkAlignment--right-padding">right-padding</link>&quot;            <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkAlignment--top-padding">top-padding</link>&quot;              <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkAlignment--xalign">xalign</link>&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write
  &quot;<link linkend="GtkAlignment--xscale">xscale</link>&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write
  &quot;<link linkend="GtkAlignment--yalign">yalign</link>&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write
  &quot;<link linkend="GtkAlignment--yscale">yscale</link>&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write
</synopsis>
</refsect1>



<refsect1 id="GtkAlignment.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkAlignment"><type>GtkAlignment</type></link> widget controls the alignment and size of its child widget.
It has four settings: xscale, yscale, xalign, and yalign.
</para>
<para>
The scale settings are used to specify how much the child widget should
expand to fill the space allocated to the <link linkend="GtkAlignment"><type>GtkAlignment</type></link>.
The values can range from 0 (meaning the child doesn't expand at all) to
1 (meaning the child expands to fill all of the available space).
</para>
<para>
The align settings are used to place the child widget within the available
area. The values range from 0 (top or left) to 1 (bottom or right).
Of course, if the scale settings are both set to 1, the alignment settings
have no effect.
</para>
</refsect1>

<refsect1 id="GtkAlignment.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkAlignment-struct" role="struct">
<title>GtkAlignment</title>
<indexterm zone="GtkAlignment-struct"><primary sortas="Alignment">GtkAlignment</primary></indexterm><programlisting>typedef struct _GtkAlignment GtkAlignment;</programlisting>
<para>
The <link linkend="GtkAlignment-struct"><type>GtkAlignment</type></link> struct contains private data only, and should
be accessed using the functions below.
</para></refsect2>
<refsect2 id="gtk-alignment-new" role="function">
<title>gtk_alignment_new ()</title>
<indexterm zone="gtk-alignment-new"><primary sortas="alignment_new">gtk_alignment_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_alignment_new                   (<link linkend="gfloat">gfloat</link> xalign,
                                                         <link linkend="gfloat">gfloat</link> yalign,
                                                         <link linkend="gfloat">gfloat</link> xscale,
                                                         <link linkend="gfloat">gfloat</link> yscale);</programlisting>
<para>
Creates a new <link linkend="GtkAlignment"><type>GtkAlignment</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>xalign</parameter>&#160;:</term>
<listitem><simpara>the horizontal alignment of the child widget, from 0 (left) to 1
(right).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>yalign</parameter>&#160;:</term>
<listitem><simpara>the vertical alignment of the child widget, from 0 (top) to 1
(bottom).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>xscale</parameter>&#160;:</term>
<listitem><simpara>the amount that the child widget expands horizontally to fill up
unused space, from 0 to 1.
A value of 0 indicates that the child widget should never expand.
A value of 1 indicates that the child widget will expand to fill all of the
space allocated for the <link linkend="GtkAlignment"><type>GtkAlignment</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>yscale</parameter>&#160;:</term>
<listitem><simpara>the amount that the child widget expands vertically to fill up
unused space, from 0 to 1. The values are similar to <parameter>xscale</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the new <link linkend="GtkAlignment"><type>GtkAlignment</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-alignment-set" role="function">
<title>gtk_alignment_set ()</title>
<indexterm zone="gtk-alignment-set"><primary sortas="alignment_set">gtk_alignment_set</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_alignment_set                   (<link linkend="GtkAlignment">GtkAlignment</link> *alignment,
                                                         <link linkend="gfloat">gfloat</link> xalign,
                                                         <link linkend="gfloat">gfloat</link> yalign,
                                                         <link linkend="gfloat">gfloat</link> xscale,
                                                         <link linkend="gfloat">gfloat</link> yscale);</programlisting>
<para>
Sets the <link linkend="GtkAlignment"><type>GtkAlignment</type></link> values.
</para><variablelist role="params">
<varlistentry><term><parameter>alignment</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkAlignment"><type>GtkAlignment</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>xalign</parameter>&#160;:</term>
<listitem><simpara>the horizontal alignment of the child widget, from 0 (left) to 1
(right).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>yalign</parameter>&#160;:</term>
<listitem><simpara>the vertical alignment of the child widget, from 0 (top) to 1
(bottom).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>xscale</parameter>&#160;:</term>
<listitem><simpara>the amount that the child widget expands horizontally to fill up
unused space, from 0 to 1.
A value of 0 indicates that the child widget should never expand.
A value of 1 indicates that the child widget will expand to fill all of the
space allocated for the <link linkend="GtkAlignment"><type>GtkAlignment</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>yscale</parameter>&#160;:</term>
<listitem><simpara>the amount that the child widget expands vertically to fill up
unused space, from 0 to 1. The values are similar to <parameter>xscale</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-alignment-get-padding" role="function" condition="since:2.4">
<title>gtk_alignment_get_padding ()</title>
<indexterm zone="gtk-alignment-get-padding" role="2.4"><primary sortas="alignment_get_padding">gtk_alignment_get_padding</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_alignment_get_padding           (<link linkend="GtkAlignment">GtkAlignment</link> *alignment,
                                                         <link linkend="guint">guint</link> *padding_top,
                                                         <link linkend="guint">guint</link> *padding_bottom,
                                                         <link linkend="guint">guint</link> *padding_left,
                                                         <link linkend="guint">guint</link> *padding_right);</programlisting>
<para>
Gets the padding on the different sides of the widget.
See <link linkend="gtk-alignment-set-padding"><function>gtk_alignment_set_padding()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>alignment</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkAlignment"><type>GtkAlignment</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_top</parameter>&#160;:</term>
<listitem><simpara> location to store the padding for the top of the widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_bottom</parameter>&#160;:</term>
<listitem><simpara> location to store the padding for the bottom of the widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_left</parameter>&#160;:</term>
<listitem><simpara> location to store the padding for the left of the widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_right</parameter>&#160;:</term>
<listitem><simpara> location to store the padding for the right of the widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-alignment-set-padding" role="function" condition="since:2.4">
<title>gtk_alignment_set_padding ()</title>
<indexterm zone="gtk-alignment-set-padding" role="2.4"><primary sortas="alignment_set_padding">gtk_alignment_set_padding</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_alignment_set_padding           (<link linkend="GtkAlignment">GtkAlignment</link> *alignment,
                                                         <link linkend="guint">guint</link> padding_top,
                                                         <link linkend="guint">guint</link> padding_bottom,
                                                         <link linkend="guint">guint</link> padding_left,
                                                         <link linkend="guint">guint</link> padding_right);</programlisting>
<para>
Sets the padding on the different sides of the widget.
The padding adds blank space to the sides of the widget. For instance,
this can be used to indent the child widget towards the right by adding
padding on the left.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>alignment</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkAlignment"><type>GtkAlignment</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_top</parameter>&#160;:</term>
<listitem><simpara> the padding at the top of the widget
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_bottom</parameter>&#160;:</term>
<listitem><simpara> the padding at the bottom of the widget
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_left</parameter>&#160;:</term>
<listitem><simpara> the padding at the left of the widget
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>padding_right</parameter>&#160;:</term>
<listitem><simpara> the padding at the right of the widget.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>

</refsect1>
<refsect1 id="GtkAlignment.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkAlignment--bottom-padding" role="property"><title>The <literal>&quot;bottom-padding&quot;</literal> property</title>
<indexterm zone="GtkAlignment--bottom-padding" role="2.4"><primary sortas="Alignment:bottom-padding">GtkAlignment:bottom-padding</primary></indexterm><programlisting>  &quot;bottom-padding&quot;           <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>
The padding to insert at the bottom of the widget.</para>
<para>
</para><para>Allowed values: &lt;= G_MAXINT</para>
<para>Default value: 0</para>
<para>Since 2.4</para>
</refsect2>
<refsect2 id="GtkAlignment--left-padding" role="property"><title>The <literal>&quot;left-padding&quot;</literal> property</title>
<indexterm zone="GtkAlignment--left-padding" role="2.4"><primary sortas="Alignment:left-padding">GtkAlignment:left-padding</primary></indexterm><programlisting>  &quot;left-padding&quot;             <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>
The padding to insert at the left of the widget.</para>
<para>
</para><para>Allowed values: &lt;= G_MAXINT</para>
<para>Default value: 0</para>
<para>Since 2.4</para>
</refsect2>
<refsect2 id="GtkAlignment--right-padding" role="property"><title>The <literal>&quot;right-padding&quot;</literal> property</title>
<indexterm zone="GtkAlignment--right-padding" role="2.4"><primary sortas="Alignment:right-padding">GtkAlignment:right-padding</primary></indexterm><programlisting>  &quot;right-padding&quot;            <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>
The padding to insert at the right of the widget.</para>
<para>
</para><para>Allowed values: &lt;= G_MAXINT</para>
<para>Default value: 0</para>
<para>Since 2.4</para>
</refsect2>
<refsect2 id="GtkAlignment--top-padding" role="property"><title>The <literal>&quot;top-padding&quot;</literal> property</title>
<indexterm zone="GtkAlignment--top-padding" role="2.4"><primary sortas="Alignment:top-padding">GtkAlignment:top-padding</primary></indexterm><programlisting>  &quot;top-padding&quot;              <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>
The padding to insert at the top of the widget.</para>
<para>
</para><para>Allowed values: &lt;= G_MAXINT</para>
<para>Default value: 0</para>
<para>Since 2.4</para>
</refsect2>
<refsect2 id="GtkAlignment--xalign" role="property"><title>The <literal>&quot;xalign&quot;</literal> property</title>
<indexterm zone="GtkAlignment--xalign"><primary sortas="Alignment:xalign">GtkAlignment:xalign</primary></indexterm><programlisting>  &quot;xalign&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write</programlisting>
<para>Horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned.</para><para>Allowed values: [0,1]</para>
<para>Default value: 0.5</para>
</refsect2>
<refsect2 id="GtkAlignment--xscale" role="property"><title>The <literal>&quot;xscale&quot;</literal> property</title>
<indexterm zone="GtkAlignment--xscale"><primary sortas="Alignment:xscale">GtkAlignment:xscale</primary></indexterm><programlisting>  &quot;xscale&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write</programlisting>
<para>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.</para><para>Allowed values: [0,1]</para>
<para>Default value: 1</para>
</refsect2>
<refsect2 id="GtkAlignment--yalign" role="property"><title>The <literal>&quot;yalign&quot;</literal> property</title>
<indexterm zone="GtkAlignment--yalign"><primary sortas="Alignment:yalign">GtkAlignment:yalign</primary></indexterm><programlisting>  &quot;yalign&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write</programlisting>
<para>Vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned.</para><para>Allowed values: [0,1]</para>
<para>Default value: 0.5</para>
</refsect2>
<refsect2 id="GtkAlignment--yscale" role="property"><title>The <literal>&quot;yscale&quot;</literal> property</title>
<indexterm zone="GtkAlignment--yscale"><primary sortas="Alignment:yscale">GtkAlignment:yscale</primary></indexterm><programlisting>  &quot;yscale&quot;                   <link linkend="gfloat">gfloat</link>                : Read / Write</programlisting>
<para>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.</para><para>Allowed values: [0,1]</para>
<para>Default value: 1</para>
</refsect2>
</refsect1>




</refentry>
