1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.SizeGroup</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtksettings.html" title="gtk.Settings"><link rel="next" href="class-gtksocket.html" title="gtk.Socket"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.SizeGroup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtksettings.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtksocket.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtksizegroup"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.SizeGroup</h2><p>gtk.SizeGroup — an object that groups widgets so they request the same
size</p></div><div class="refsect1" lang="en"><a name="id3483966"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.SizeGroup</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtksizegroup.html#constructor-gtksizegroup" title="Constructor">gtk.SizeGroup</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksizegroup.html#method-gtksizegroup--set-mode" title="gtk.SizeGroup.set_mode">set_mode</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksizegroup.html#method-gtksizegroup--get-mode" title="gtk.SizeGroup.get_mode">get_mode</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksizegroup.html#method-gtksizegroup--set-ignore-hidden" title="gtk.SizeGroup.set_ignore_hidden">set_ignore_hidden</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>ignore_hidden</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksizegroup.html#method-gtksizegroup--get-ignore-hidden" title="gtk.SizeGroup.get_ignore_hidden">get_ignore_hidden</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksizegroup.html#method-gtksizegroup--add-widget" title="gtk.SizeGroup.add_widget">add_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksizegroup.html#method-gtksizegroup--remove-widget" title="gtk.SizeGroup.remove_widget">remove_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3484172"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup">gtk.SizeGroup</a>
</pre></div><div class="refsect1" lang="en"><a name="id3484198"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
</p></div><div class="refsect1" lang="en"><a name="properties-gtksizegroup"></a><h2>gtk.SizeGroup Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"ignore-hidden"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, hidden widgets are ignored
when determining the size of the group.
Default value: <code class="literal">False</code>.
Available in GTK+ 2.8 and above.</td></tr><tr valign="top"><td valign="top">"mode"</td><td valign="top">Read-Write</td><td valign="top">The directions in which the size group effects the
requested sizes of its component widgets - one of the <a class="xref" href="gtk-constants.html#gtk-sizegroup-mode-constants" title="GTK SizeGroup Mode Constants">GTK SizeGroup Mode Constants</a>.
Default value: <code class="literal">gtk.SIZE_GROUP_HORIZONTAL</code>.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtksizegroup"></a><h2>gtk.SizeGroup Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p></div><div class="refsect1" lang="en"><a name="id3484365"></a><h2>Description</h2><p><a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>
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 <a class="link" href="class-gtktable.html" title="gtk.Table"><code class="classname">gtk.Table</code></a> widget. The
size requested for each widget in a <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a> 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 <a class="link" href="class-gtksizegroup.html#method-gtksizegroup--set-mode" title="gtk.SizeGroup.set_mode"><code class="methodname">set_mode</code>()</a>
and the <a class="xref" href="gtk-constants.html#gtk-sizegroup-mode-constants" title="GTK SizeGroup Mode Constants">GTK SizeGroup Mode Constants</a>) determines whether
this applies to the horizontal size, the vertical size, or both
sizes:</p><p>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
<a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a> 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 <code class="literal">gtk.FILL</code>
flag. <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>
objects are referenced by each widget in the size group, so once you have
added all widgets to a <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>. 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.</p><p>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 <code class="literal">gtk.SIZE_GROUP_HORIZONTAL</code> or
<code class="literal">gtk.SIZE_GROUP_BOTH</code>, 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 <code class="literal">gtk.SIZE_GROUP_VERTICAL</code> or
<code class="literal">gtk.SIZE_GROUP_BOTH</code>.</p></div><div class="refsect1" lang="en"><a name="constructor-gtksizegroup"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.SizeGroup</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mode</code></strong> :</span></p></td><td>the mode for the new size
group.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a></td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>
with the mode specified by the value of <em class="parameter"><code>mode</code></em> which is
one of the <a class="xref" href="gtk-constants.html#gtk-sizegroup-mode-constants" title="GTK SizeGroup Mode Constants">GTK SizeGroup Mode Constants</a>.</p></div><div class="refsect1" lang="en"><a name="id3484606"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtksizegroup--set-mode"></a><h3>gtk.SizeGroup.set_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_mode</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mode</code></strong> :</span></p></td><td>the mode to set for the size
group.</td></tr></tbody></table><p>The <code class="methodname">set_mode</code>() method sets the "mode"
property of the size group to the value specified by
<em class="parameter"><code>mode</code></em>. The "mode" of the size group determines whether
the widgets in the size group should all have the same horizontal
requisition (see the <a class="xref" href="gtk-constants.html#gtk-sizegroup-mode-constants" title="GTK SizeGroup Mode Constants">GTK SizeGroup Mode Constants</a>).</p></div><div class="refsect2" lang="en"><a name="method-gtksizegroup--get-mode"></a><h3>gtk.SizeGroup.get_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_mode</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current mode of the size
group.</td></tr></tbody></table><p>The <code class="methodname">get_mode</code>() method returns the value
of the "mode" property of the size group. See the <a class="link" href="class-gtksizegroup.html#method-gtksizegroup--set-mode" title="gtk.SizeGroup.set_mode"><code class="methodname">set_mode</code>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtksizegroup--set-ignore-hidden"></a><h3>gtk.SizeGroup.set_ignore_hidden</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_ignore_hidden</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>ignore_hidden</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>ignore_hidden</code></strong> :</span></p></td><td>If <code class="literal">True</code> hidden widgets should
be ignored when calculating the size</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">set_ignore_hidden</code>() method sets the
"ignore-hidden" property to the value of
<em class="parameter"><code>ignore_hidden</code></em>. If
<em class="parameter"><code>ignore_hidden</code></em> is <code class="literal">True</code> invisible
widgets will be ignored when calculating size.</p></div><div class="refsect2" lang="en"><a name="method-gtksizegroup--get-ignore-hidden"></a><h3>gtk.SizeGroup.get_ignore_hidden</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_ignore_hidden</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if hidden widgets are
ignored in size calculations.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">get_ignore_hidden</code>() method returns
the value of the "ignore-hidden" property of the size group. If
"ignore-hidden" is <code class="literal">True</code>, invisible widgets are ignored in
size calculations.</p></div><div class="refsect2" lang="en"><a name="method-gtksizegroup--add-widget"></a><h3>gtk.SizeGroup.add_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>widget</code></strong> :</span></p></td><td>the <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a> to
add</td></tr></tbody></table><p>The <code class="methodname">add_widget</code>() method adds the widget
specified by <em class="parameter"><code>widget</code></em> to the <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>.
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 <a class="link" href="class-gtksizegroup.html#method-gtksizegroup--set-mode" title="gtk.SizeGroup.set_mode"><code class="methodname">set_mode</code>()</a>
method for more detail.</p></div><div class="refsect2" lang="en"><a name="method-gtksizegroup--remove-widget"></a><h3>gtk.SizeGroup.remove_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>widget</code></strong> :</span></p></td><td>the <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a> to
remove</td></tr></tbody></table><p>The remove_widget() method removes the widget specified by
widget from the <a class="link" href="class-gtksizegroup.html" title="gtk.SizeGroup"><code class="classname">gtk.SizeGroup</code></a>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtksettings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtksocket.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Settings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.Socket</td></tr></table></div></body></html>
|