<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtksizegroup">
  <refnamediv>
    <refname>gtk.SizeGroup</refname>
    <refpurpose>an object that groups widgets so they request the same
size</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.SizeGroup</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gtksizegroup">gtk.SizeGroup</link></methodname>
	<methodparam><parameter
		       role="keyword">mode</parameter></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtksizegroup--set-mode">set_mode</link></methodname>
	<methodparam><parameter
		       role="keyword">mode</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtksizegroup--get-mode">get_mode</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtksizegroup--set-ignore-hidden">set_ignore_hidden</link></methodname>
	<methodparam><parameter
		       role="keyword">ignore_hidden</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtksizegroup--get-ignore-hidden">get_ignore_hidden</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtksizegroup--add-widget">add_widget</link></methodname>
	<methodparam><parameter
		       role="keyword">widget</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtksizegroup--remove-widget">remove_widget</link></methodname>
	<methodparam><parameter
		       role="keyword">widget</parameter></methodparam>
      </methodsynopsis>

      <methodsynopsis language="python">
        <methodname><link linkend="method-gtksizegroup--get-widgets">get_widgets</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtksizegroup">gtk.SizeGroup</link>
</synopsis>

  </refsect1>
  
  <refsect1>
		<title>Implemented Interfaces</title>
		<para>
			<link linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>
			implements 
			<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
		</para>
	</refsect1>


  <refsect1 id="properties-gtksizegroup">
    <title>gtk.SizeGroup Properties</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"ignore-hidden"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, hidden widgets are ignored
when determining the size of the group.
Default value: <literal>False</literal>.
Available in GTK+ 2.8 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"mode"</entry>
	      <entry>Read-Write</entry>
	      <entry>The directions in which the size group effects the
requested sizes of its component widgets - one of the <xref 
linkend="gtk-sizegroup-mode-constants" 
endterm="gtk-sizegroup-mode-constants-title"></xref>.
Default value: <literal>gtk.SIZE_GROUP_HORIZONTAL</literal>.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtksizegroup">
    <title>gtk.SizeGroup Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
  </refsect1>

  <refsect1>
    <title>Description</title>

    <para><link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>
provides a mechanism for grouping a number of widgets together so they all
request the same amount of space. This is typically useful when you want a
column of widgets to have the same size, but you can't use a <link
linkend="class-gtktable"><classname>gtk.Table</classname></link> widget. The
size requested for each widget in a <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link> is
the maximum of the sizes that would have been requested for each widget in
the size group if they were not in the size group. The mode of the size
group (see <link
linkend="method-gtksizegroup--set-mode"><methodname>set_mode</methodname>()</link>
and the <xref linkend="gtk-sizegroup-mode-constants"
endterm="gtk-sizegroup-mode-constants-title"></xref>) determines whether
this applies to the horizontal size, the vertical size, or both
sizes:</para>

    <para>Note that size groups only affect the amount of space requested,
not the size that the widgets finally receive. If you want the widgets in a
<link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link> to
actually be the same size, you need to pack them in such a way that they get
the size they request and not more. For example, if you are packing your
widgets into a table, you would not include the <literal>gtk.FILL</literal>
flag. <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>
objects are referenced by each widget in the size group, so once you have
added all widgets to a <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>. If
the widgets in the size group are subsequently destroyed, then they will be
removed from the size group and drop their references on the size group;
when all widgets have been removed, the size group will be freed.</para>

    <para>Widgets can be part of multiple size groups; PyGTK will compute
the horizontal size of a widget from the horizontal requisition of all
widgets that can be reached from the widget by a chain of size groups of
type <literal>gtk.SIZE_GROUP_HORIZONTAL</literal> or
<literal>gtk.SIZE_GROUP_BOTH</literal>, and the vertical size from the
vertical requisition of all widgets that can be reached from the widget by a
chain of size groups of type <literal>gtk.SIZE_GROUP_VERTICAL</literal> or
<literal>gtk.SIZE_GROUP_BOTH</literal>.</para>

  </refsect1>

  <refsect1 id="constructor-gtksizegroup">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.SizeGroup</methodname>
	<methodparam><parameter
		       role="keyword">mode</parameter></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">mode</parameter>&nbsp;:</term>
	<listitem><simpara>the mode for the new size
group.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>
with the mode specified by the value of <parameter>mode</parameter> which is
one of the <xref linkend="gtk-sizegroup-mode-constants"
endterm="gtk-sizegroup-mode-constants-title"></xref>.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtksizegroup--set-mode">
      <title>gtk.SizeGroup.set_mode</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_mode</methodname>
	  <methodparam><parameter
			 role="keyword">mode</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">mode</parameter>&nbsp;:</term>
	  <listitem><simpara>the mode to set for the size
group.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_mode</methodname>() method sets the "mode"
property of the size group to the value specified by
<parameter>mode</parameter>. The "mode" of the size group determines whether
the widgets in the size group should all have the same horizontal
requisition (see the <xref linkend="gtk-sizegroup-mode-constants"
endterm="gtk-sizegroup-mode-constants-title"></xref>).</para>

    </refsect2>

    <refsect2 id="method-gtksizegroup--get-mode">
      <title>gtk.SizeGroup.get_mode</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_mode</methodname>
	  <methodparam></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current mode of the size
group.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_mode</methodname>() method returns the value
of the "mode" property of the size group. See the <link
linkend="method-gtksizegroup--set-mode"><methodname>set_mode</methodname>()</link> 
method.</para>

    </refsect2>

    <refsect2 id="method-gtksizegroup--set-ignore-hidden">
      <title>gtk.SizeGroup.set_ignore_hidden</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_ignore_hidden</methodname>
	  <methodparam><parameter
			 role="keyword">ignore_hidden</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">ignore_hidden</parameter>&nbsp;:</term>
	  <listitem><simpara>If <literal>True</literal> hidden widgets should
be ignored when calculating the size</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>set_ignore_hidden</methodname>() method sets the
"ignore-hidden" property to the value of
<parameter>ignore_hidden</parameter>. If
<parameter>ignore_hidden</parameter> is <literal>True</literal> invisible
widgets will be ignored when calculating size.</para>

    </refsect2>

    <refsect2 id="method-gtksizegroup--get-ignore-hidden">
      <title>gtk.SizeGroup.get_ignore_hidden</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_ignore_hidden</methodname>
	  <methodparam></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if hidden widgets are
ignored in size calculations.</simpara></listitem>
	</varlistentry>
      </variablelist>

       <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_ignore_hidden</methodname>() method returns
the value of the "ignore-hidden" property of the size group. If
"ignore-hidden" is <literal>True</literal>, invisible widgets are ignored in
size calculations.</para>

    </refsect2>

    <refsect2 id="method-gtksizegroup--add-widget">
      <title>gtk.SizeGroup.add_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>add_widget</methodname>
	  <methodparam><parameter
			 role="keyword">widget</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">widget</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtkwidget"><classname>gtk.Widget</classname></link> to
add</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>add_widget</methodname>() method adds the widget
specified by <parameter>widget</parameter> to the <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>.
The requisition of the widget will then be determined as the maximum of its
requisition and the requisition of the other widgets in the size group.
Whether this applies horizontally, vertically, or in both directions depends
on the mode of the size group. See the <link
linkend="method-gtksizegroup--set-mode"><methodname>set_mode</methodname>()</link> 
method for more detail.</para>

    </refsect2>

    <refsect2 id="method-gtksizegroup--remove-widget">
      <title>gtk.SizeGroup.remove_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>remove_widget</methodname>
	  <methodparam><parameter
			 role="keyword">widget</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">widget</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtkwidget"><classname>gtk.Widget</classname></link> to
remove</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The remove_widget() method removes the widget specified by
widget from the <link
linkend="class-gtksizegroup"><classname>gtk.SizeGroup</classname></link>.</para>

    </refsect2>

    <refsect2 id="method-gtksizegroup--get-widgets">
      <title>gtk.SizeGroup.get_widgets</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_widgets</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a list of widgets.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <methodname>get_widgets</methodname>() method returns the list of
      widgets associated with size_group.</para>

    </refsect2>

  </refsect1>

</refentry>
