1
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Misc</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-gtkmessagedialog.html" title="gtk.MessageDialog"><link rel="next" href="class-gtkmountoperation.html" title="gtk.MountOperation"></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.Misc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkmessagedialog.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkmountoperation.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkmisc"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Misc</h2><p>gtk.Misc — a base class for widgets with alignments and
2
padding.</p></div><div class="refsect1" lang="en"><a name="id3564380"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Misc</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a></span></span>):
3
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--set-alignment" title="gtk.Misc.set_alignment">set_alignment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xalign</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>yalign</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--get-alignment" title="gtk.Misc.get_alignment">get_alignment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--set-padding" title="gtk.Misc.set_padding">set_padding</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xpad</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ypad</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--get-padding" title="gtk.Misc.get_padding">get_padding</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3564531"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
2
padding.</p></div><div class="refsect1" lang="en"><a name="id3765186"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Misc</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a></span></span>):
3
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--set-alignment" title="gtk.Misc.set_alignment">set_alignment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xalign</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>yalign</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--get-alignment" title="gtk.Misc.get_alignment">get_alignment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--set-padding" title="gtk.Misc.set_padding">set_padding</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xpad</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>ypad</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmisc.html#method-gtkmisc--get-padding" title="gtk.Misc.get_padding">get_padding</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3765337"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
4
4
+-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
5
5
+-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
6
6
+-- <a class="link" href="class-gtkmisc.html" title="gtk.Misc">gtk.Misc</a>
7
</pre></div><div class="refsect1" lang="en"><a name="id3564570"></a><h2>Implemented Interfaces</h2><p>
7
</pre></div><div class="refsect1" lang="en"><a name="id3765376"></a><h2>Implemented Interfaces</h2><p>
8
8
<a class="link" href="class-gtkmisc.html" title="gtk.Misc"><code class="classname">gtk.Misc</code></a>
10
10
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
11
11
</p></div><div class="refsect1" lang="en"><a name="properties-gtkmisc"></a><h2>gtk.Misc Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><p><a class="link" href="class-gtkwidget.html#properties-gtkwidget" title="gtk.Widget Properties">gtk.Widget Properties</a></p><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">"xalign"</td><td valign="top">Read-Write</td><td valign="top">The horizontal alignment, from 0.0 to 1.0</td></tr><tr valign="top"><td valign="top">"xpad"</td><td valign="top">Read-Write</td><td valign="top">The amount of space to add on the left and right of the
12
12
widget, in pixels</td></tr><tr valign="top"><td valign="top">"yalign"</td><td valign="top">Read-Write</td><td valign="top">The vertical alignment, from 0.0 to 1.0</td></tr><tr valign="top"><td valign="top">"ypad"</td><td valign="top">Read-Write</td><td valign="top">The amount of space to add above and below the widget,
13
in pixels</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="style-properties-gtkmisc"></a><h2>gtk.Misc Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkmisc"></a><h2>gtk.Misc Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p></div><div class="refsect1" lang="en"><a name="id3564793"></a><h2>Description</h2><p>The <a class="link" href="class-gtkmisc.html" title="gtk.Misc"><code class="classname">gtk.Misc</code></a> widget is an
13
in pixels</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="style-properties-gtkmisc"></a><h2>gtk.Misc Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkmisc"></a><h2>gtk.Misc Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p></div><div class="refsect1" lang="en"><a name="id3765598"></a><h2>Description</h2><p>The <a class="link" href="class-gtkmisc.html" title="gtk.Misc"><code class="classname">gtk.Misc</code></a> widget is an
14
14
abstract widget used to derive subclasses which have alignment and padding
15
15
attributes. The horizontal and vertical padding attributes allow extra space
16
16
to be added around the widget. The horizontal and vertical alignment
19
19
minus the widget size) to place to the left or above the widget for x and y
20
20
alignment respectively. Note that if the widget is added to a container in
21
21
such a way that it expands automatically to fill its allocated area, the
22
alignment settings will have no effect.</p></div><div class="refsect1" lang="en"><a name="id3564822"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkmisc--set-alignment"></a><h3>gtk.Misc.set_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_alignment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xalign</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>yalign</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>xalign</code></strong> :</span></p></td><td>the horizontal alignment</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>yalign</code></strong> :</span></p></td><td>the vertical alignment</td></tr></tbody></table><p>The <code class="methodname">set_alignment</code>() method sets the
22
alignment settings will have no effect.</p></div><div class="refsect1" lang="en"><a name="id3765628"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkmisc--set-alignment"></a><h3>gtk.Misc.set_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_alignment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xalign</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>yalign</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>xalign</code></strong> :</span></p></td><td>the horizontal alignment</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>yalign</code></strong> :</span></p></td><td>the vertical alignment</td></tr></tbody></table><p>The <code class="methodname">set_alignment</code>() method sets the
23
23
alignment of the widget in its allocated space. <em class="parameter"><code>xalign</code></em>
24
24
sets the fraction (0.0-1.0) of free space (horizontal allocation minus
25
25
widget width) to place to the left of the widget.