/usr/share/gtk-doc/html/pygtk/class-gtkbutton.html is in python-gtk2-doc 2.24.0-5.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Button</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" 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-gtkbuilder.html" title="gtk.Builder"><link rel="next" href="class-gtkbuttonbox.html" title="gtk.ButtonBox"></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.Button</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkbuilder.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkbuttonbox.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.Button"><a name="class-gtkbutton"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Button</h2><p>gtk.Button — A pushbutton widget that issues a signal when
clicked.</p></div><div class="refsect1" title="Synopsis"><a name="id3565077"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Button</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkbutton.html#constructor-gtkbutton" title="Constructor">gtk.Button</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_underline</code></strong></span><span class="initializer">=True</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--pressed" title="gtk.Button.pressed">pressed</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--released" title="gtk.Button.released">released</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--clicked" title="gtk.Button.clicked">clicked</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--enter" title="gtk.Button.enter">enter</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--leave" title="gtk.Button.leave">leave</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-relief" title="gtk.Button.set_relief">set_relief</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>newstyle</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-relief" title="gtk.Button.get_relief">get_relief</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-label" title="gtk.Button.set_label">set_label</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-label" title="gtk.Button.get_label">get_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-use-underline" title="gtk.Button.set_use_underline">set_use_underline</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_underline</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-use-underline" title="gtk.Button.get_use_underline">get_use_underline</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-use-stock" title="gtk.Button.set_use_stock">set_use_stock</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_stock</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-use-stock" title="gtk.Button.get_use_stock">get_use_stock</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-focus-on-click" title="gtk.Button.set_focus_on_click">set_focus_on_click</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>focus_on_click</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-focus-on-click" title="gtk.Button.get_focus_on_click">get_focus_on_click</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-alignment" title="gtk.Button.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-gtkbutton.html#method-gtkbutton--get-alignment" title="gtk.Button.get_alignment">get_alignment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-image" title="gtk.Button.set_image">set_image</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>image</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-image" title="gtk.Button.get_image">get_image</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--set-image-position" title="gtk.Button.set_image_position">set_image_position</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-image-position" title="gtk.Button.get_image_position">get_image_position</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkbutton.html#method-gtkbutton--get-event-window" title="gtk.Button.get_event_window">get_event_window</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3546755"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a class="link" href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a class="link" href="class-gtkbutton.html" title="gtk.Button">gtk.Button</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id3546805"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkbutton.html" title="gtk.Button"><code class="classname">gtk.Button</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" title="gtk.Button Properties"><a name="properties-gtkbutton"></a><h2>gtk.Button 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><p><a class="link" href="class-gtkcontainer.html#properties-gtkcontainer" title="gtk.Container Properties">gtk.Container 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 width="1in"><col width="1in"><col width="3.5in"></colgroup><tbody><tr valign="top"><td valign="top">"focus-on-click"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">True</code> the button grabs focus when
it is clicked with the mouse. Default value:
<code class="literal">True</code>. This property is available in GTK+ 2.4 and
above.</td></tr><tr valign="top"><td valign="top">"image"</td><td valign="top">Read/Write</td><td valign="top">The child widget to appear next to the button text. Default
value: <code class="literal">None</code>.
This property is available in GTK+ 2.6 and above.</td></tr><tr valign="top"><td valign="top">"image-position"</td><td valign="top">Read/Write</td><td valign="top">The position of the image relative to the text inside the
button. One of the <a class="xref" href="gtk-constants.html#gtk-position-type-constants" title="GTK Position Type Constants">GTK Position Type Constants</a>. Default
value: <code class="literal">gtk.POS_LEFT</code>. This property is
available in GTK+ 2.10 and above.</td></tr><tr valign="top"><td valign="top">"label"</td><td valign="top">Read/Write</td><td valign="top">Text of the label widget inside the button, if the button
contains a label widget. Default value: <code class="literal">None</code>.</td></tr><tr valign="top"><td valign="top">"relief"</td><td valign="top">Read/Write</td><td valign="top">The border relief style. One of:
<code class="literal">gtk.RELIEF_NORMAL</code>, <code class="literal">gtk.RELIEF_HALF</code> or
<code class="literal">gtk.RELIEF_NONE</code>. Default value:
<code class="literal">gtk.RELIEF_NORMAL</code>.</td></tr><tr valign="top"><td valign="top">"use-stock"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">True</code>, the label text is used to pick
a stock item instead of being displayed.
Default value: <code class="literal">False</code>.</td></tr><tr valign="top"><td valign="top">"use-underline"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">True</code>, an underscore in the text
indicates the next character should be underlined and used for the mnemonic
accelerator key if it is the first character so marked.
Default value: <code class="literal">False</code>.</td></tr><tr valign="top"><td valign="top">"xalign"</td><td valign="top">Read/Write</td><td valign="top">If the
child of the button is a <a class="link" href="class-gtkmisc.html" title="gtk.Misc"><code class="classname">gtk.Misc</code></a> or
<a class="link" href="class-gtkalignment.html" title="gtk.Alignment"><code class="classname">gtk.Alignment</code></a>,
this property can be used to control it's horizontal
alignment. The value ranges from 0.0 to 1.0 representing the fraction
of freespace to the left of the widget. Default value: 0.5.
This property is available in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"yalign"</td><td valign="top">Read/Write</td><td valign="top">If the
child of the button is a <a class="link" href="class-gtkmisc.html" title="gtk.Misc"><code class="classname">gtk.Misc</code></a> or
<a class="link" href="class-gtkalignment.html" title="gtk.Alignment"><code class="classname">gtk.Alignment</code></a>,
this property can be used to control it's vertical
alignment. The value ranges from 0.0 to 1.0 representing the fraction
of freespace above the widget. Default value: 0.5.
This property is available in GTK+ 2.4 and above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.Button Style Properties"><a name="style-properties-gtkbutton"></a><h2>gtk.Button 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 class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="3.5in"></colgroup><tbody><tr valign="top"><td valign="top">"child-displacement-x"</td><td valign="top">Read</td><td valign="top">The number of pixels in the x direction to move the child
when the button is depressed. Default value: 0</td></tr><tr valign="top"><td valign="top">"child-displacement-y"</td><td valign="top">Read</td><td valign="top">The number of pixels in the y direction to move the child
when the button is depressed. Default value: 0</td></tr><tr valign="top"><td valign="top">"default-border"</td><td valign="top">Read</td><td valign="top">The extra space to add for
<code class="literal">gtk.CAN_DEFAULT</code> buttons as a <a class="link" href="class-gtkborder.html" title="gtk.Border"><code class="classname">gtk.Border</code></a></td></tr><tr valign="top"><td valign="top">"default-outside-border"</td><td valign="top">Read</td><td valign="top">The extra space to add for
<code class="literal">gtk.CAN_DEFAULT</code> buttons always drawn outside
the border as a <a class="link" href="class-gtkborder.html" title="gtk.Border"><code class="classname">gtk.Border</code></a></td></tr><tr valign="top"><td valign="top">"displace-focus"</td><td valign="top">Read</td><td valign="top">If <code class="literal">True</code> the "child-displacement-x" and
"child-displacement-y" properties should also affect the focus
rectangle. Default value: <code class="literal">False</code>. This property
is available in GTK+ 2.6 and above.</td></tr><tr valign="top"><td valign="top">"image-spacing"</td><td valign="top">Read</td><td valign="top">Spacing in pixels between the image and the label. Allowed values: >=0. Default value: 2.</td></tr><tr valign="top"><td valign="top">"inner-border"</td><td valign="top">Read</td><td valign="top">The border between the button edges and child as a <a class="link" href="class-gtkborder.html" title="gtk.Border"><code class="classname">gtk.Border</code></a>.
This property is available in GTK+ 2.10 and above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.Button Signal Prototypes"><a name="signal-prototypes-gtkbutton"></a><h2>gtk.Button 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><p><a class="link" href="class-gtkcontainer.html#signal-prototypes-gtkcontainer" title="gtk.Container Signal Prototypes">gtk.Container Signal Prototypes</a></p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gtkbutton.html#signal-gtkbutton--activate" title='The "activate" gtk.Button Signal'>activate</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkbutton.html#signal-gtkbutton--clicked" title='The "clicked" gtk.Button Signal'>clicked</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkbutton.html#signal-gtkbutton--enter" title='The "enter" gtk.Button Signal'>enter</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkbutton.html#signal-gtkbutton--leave" title='The "leave" gtk.Button Signal'>leave</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkbutton.html#signal-gtkbutton--pressed" title='The "pressed" gtk.Button Signal'>pressed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkbutton.html#signal-gtkbutton--released" title='The "released" gtk.Button Signal'>released</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id3618762"></a><h2>Description</h2><p>The <a class="link" href="class-gtkbutton.html" title="gtk.Button"><code class="classname">gtk.Button</code></a> widget is
usually displayed as a pushbutton with a text label (<a class="link" href="class-gtklabel.html" title="gtk.Label"><code class="classname">gtk.Label</code></a>) though it
can contain any valid widget. The <a class="link" href="class-gtkbutton.html" title="gtk.Button"><code class="classname">gtk.Button</code></a> is
generally used to attach a callback function or method that is called when
the button is clicked. Buttons generate signals that indicate:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">"clicked" - the user pressed and released a mouse button
over the button</li><li class="listitem">"pressed" - the user pressed a mouse button over the
button</li><li class="listitem">"released" - the user released a mouse button over the
button</li><li class="listitem">"enter" - the pointer entered the button</li><li class="listitem">"leave" - the pointer left the button</li></ul></div><p>The "clicked" signal is usually the only signal that an
application needs to handle.</p><p>If a label is being used by the button its text (the "label"
property) is retrieved using the <a class="link" href="class-gtkbutton.html#method-gtkbutton--get-label" title="gtk.Button.get_label"><code class="methodname">get_label</code>()</a>
method. The label text is changed using the <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-label" title="gtk.Button.set_label"><code class="methodname">set_label</code>()</a>
method.</p><p>The property ("use_underline") that tells a button to use the
first underscore to indicate a mnemonic key is changed using the <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-use-underline" title="gtk.Button.set_use_underline"><code class="methodname">set_use_underline</code>().</a>
method. It can be retrieved using the <a class="link" href="class-gtkbutton.html#method-gtkbutton--get-use-underline" title="gtk.Button.get_use_underline"><code class="methodname">get_use_underline</code>()</a>
method.</p><p>The button's relief style (the "relief" property) is retrieved
using the method <a class="link" href="class-gtkbutton.html#method-gtkbutton--get-relief" title="gtk.Button.get_relief"><code class="methodname">get_relief</code>()</a>.
The relief style is set to one of <code class="literal">gtk.RELIEF_NONE</code>,
<code class="literal">gtk.RELIEF_HALF</code> or <code class="literal">gtk.RELIEF_NORMAL</code>
using the method <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-relief" title="gtk.Button.set_relief"><code class="methodname">set_relief</code>()</a>.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkbutton"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.Button</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_underline</code></strong></span><span class="initializer">=True</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>label</code></strong> :</span></p></td><td>the text to be displayed by the button label
including an underscore to indicate the mnemonic character if desired or
<code class="literal">None</code> if no label is required.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>stock</code></strong> :</span></p></td><td>the stock id identifying the stock image and text
to be used in the button or <code class="literal">None</code> if no stock id is to be
used.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>use_underline</code></strong> :</span></p></td><td>if <code class="literal">True</code>, an underscore in the
text indicates the next character should be underlined and used for the
mnemonic accelerator key if it is the first character so
marked. Available in PyGTK 2.4 and above.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new button object</td></tr></tbody></table><p>Creates a new button widget with the content depending on the
parameters: <em class="parameter"><code>label</code></em>, <em class="parameter"><code>stock</code></em> and
<em class="parameter"><code>use_underline</code></em>. The default values for
<em class="parameter"><code>stock</code></em> and <em class="parameter"><code>label</code></em> are
<code class="literal">None</code> and, in PyGTK 2.4 and above,
<em class="parameter"><code>use_underline</code></em> is available and defaults to
<code class="literal">True</code>. If both <em class="parameter"><code>label</code></em> and
<em class="parameter"><code>stock</code></em> are specified <em class="parameter"><code>stock</code></em>
takes precedence. If neither is specified the button is created with no
child widget. A child widget can be added later with the <a class="link" href="class-gtkcontainer.html#method-gtkcontainer--add" title="gtk.Container.add"><code class="methodname">add</code>()</a>
method.</p><p>If <em class="parameter"><code>stock</code></em> is specified the "use-stock"
property will be set to <code class="literal">True</code>.</p><p>If <em class="parameter"><code>label</code></em> is specified the "label" property
will be set with the text of the label, the "use_underline" property will be
set to <code class="literal">True</code> and any characters that are preceded by an
underscore are underlined (use two underscores to insert an underscore in a
label). The first underscored character will become the mnemonic character
used as the keyboard accelerator for the button when pressed simultaneously
with the <span class="keycap"><strong>Alt</strong></span> key. In PyGTK 2.4 and above the
"use-underline" property can be set by using the optional
<em class="parameter"><code>use_underline</code></em> parameter.</p></div><div class="refsect1" title="Methods"><a name="id3619184"></a><h2>Methods</h2><div class="refsect2" title="gtk.Button.pressed"><a name="method-gtkbutton--pressed"></a><h3>gtk.Button.pressed</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">pressed</span>(<span class="methodparam"></span>)</code></pre><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated since PyGTK 2.22 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--button-press-event" title='The "button-press-event" gtk.Widget Signal'>button-press-event</a>"
signal.</p></div><p>The <code class="methodname">pressed</code>() method emits the
"pressed" signal to the button.</p></div><div class="refsect2" title="gtk.Button.released"><a name="method-gtkbutton--released"></a><h3>gtk.Button.released</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">released</span>(<span class="methodparam"></span>)</code></pre><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated since PyGTK 2.22 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--button-release-event" title='The "button-release-event" gtk.Widget Signal'>button-release-event</a>"
signal.</p></div><p>The <code class="methodname">released</code>() method emits the
"released" signal to the button.</p></div><div class="refsect2" title="gtk.Button.clicked"><a name="method-gtkbutton--clicked"></a><h3>gtk.Button.clicked</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">clicked</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">clicked</code>() method emits the
"clicked" signal to the button.</p></div><div class="refsect2" title="gtk.Button.enter"><a name="method-gtkbutton--enter"></a><h3>gtk.Button.enter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">enter</span>(<span class="methodparam"></span>)</code></pre><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated since PyGTK 2.22 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--enter-notify-event" title='The "enter-notify-event" gtk.Widget Signal'>enter-notify-event</a>"
signal.</p></div><p>The <code class="methodname">enter</code>() method emits the "enter"
signal to the button.</p></div><div class="refsect2" title="gtk.Button.leave"><a name="method-gtkbutton--leave"></a><h3>gtk.Button.leave</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">leave</span>(<span class="methodparam"></span>)</code></pre><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated since PyGTK 2.22 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--leave-notify-event" title='The "leave-notify-event" gtk.Widget Signal'>leave-notify-event</a>"
signal.</p></div><p>The <code class="methodname">leave</code>() method emits the "leave"
signal to the button.</p></div><div class="refsect2" title="gtk.Button.set_relief"><a name="method-gtkbutton--set-relief"></a><h3>gtk.Button.set_relief</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_relief</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>newstyle</code></em></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>newstyle</code></strong> :</span></p></td><td>one of <code class="literal">gtk.RELIEF_NONE</code>,
<code class="literal">gtk.RELIEF_NORMAL</code> or
<code class="literal">gtk.RELIEF_HALF</code></td></tr></tbody></table><p>The <code class="methodname">set_relief</code>() method sets the relief
style of the edges of the button. Three styles exist,
<code class="literal">gtk.RELIEF_NORMAL</code>, <code class="literal">gtk.RELIEF_HALF</code>,
<code class="literal">gtk.RELIEF_NONE</code>. The default style is, as one can guess,
<code class="literal">gtk.RELIEF_NORMAL</code>.</p></div><div class="refsect2" title="gtk.Button.get_relief"><a name="method-gtkbutton--get-relief"></a><h3>gtk.Button.get_relief</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_relief</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 relief style</td></tr></tbody></table><p>The <code class="methodname">get_relief</code>() method retrieves the
current relief style (the "relief" property) set for the button.</p></div><div class="refsect2" title="gtk.Button.set_label"><a name="method-gtkbutton--set-label"></a><h3>gtk.Button.set_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_label</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>label</code></em></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>label</code></strong> :</span></p></td><td>a string to be set as the text in the button
label</td></tr></tbody></table><p>The <code class="methodname">set_label</code>() method sets the text of
the button label to <em class="parameter"><code>label</code></em> (also sets the "label"
property). This string is also used to select the stock item if the
"use_stock" property is <code class="literal">True</code> and the string references a
stock item. Any previously set labels will be cleared.</p></div><div class="refsect2" title="gtk.Button.get_label"><a name="method-gtkbutton--get-label"></a><h3>gtk.Button.get_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_label</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 text of the label
widget.</td></tr></tbody></table><p>The <code class="methodname">get_label</code>() method retrieves the
text from the label of the button, as set by <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-label" title="gtk.Button.set_label"><code class="methodname">set_label</code>()</a>
or by the <a class="link" href="class-gtkbutton.html#constructor-gtkbutton" title="Constructor"><code class="methodname">gtk.Button</code>()</a>
constructor. This string is owned by the widget and must not be modified or
freed. If the label text has not been set the return value will be
<code class="literal">None</code>. This will be the case if you create an empty button
with <a class="link" href="class-gtkbutton.html#constructor-gtkbutton" title="Constructor"><code class="methodname">gtk.Button</code>()</a>
to use as a container.</p></div><div class="refsect2" title="gtk.Button.set_use_underline"><a name="method-gtkbutton--set-use-underline"></a><h3>gtk.Button.set_use_underline</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_underline</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_underline</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"><em class="parameter"><code>use_underline</code></em> :</span></p></td><td><code class="literal">True</code> if underscores in the text
indicate mnemonics</td></tr></tbody></table><p>The <code class="methodname">set_use_underline</code>() method sets the
"use_underline" property to the value of
<em class="parameter"><code>use_underline</code></em>. If
<em class="parameter"><code>use_underline</code></em> is <code class="literal">True</code>, an
underscore in the text of the button label indicates that the next character
should be underlined and used for the mnemonic accelerator key if it is also
the first underlined character.</p></div><div class="refsect2" title="gtk.Button.get_use_underline"><a name="method-gtkbutton--get-use-underline"></a><h3>gtk.Button.get_use_underline</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_underline</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 an underscore in the button
label indicates the mnemonic accelerator keys.</td></tr></tbody></table><p>The <code class="methodname">get_use_underline</code>() method returns
whether the "use_underline" property is <code class="literal">True</code> meaning that
an underscore in the button label indicates a mnemonic. See <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-use-underline" title="gtk.Button.set_use_underline"><code class="methodname">set_use_underline</code>()</a>.</p></div><div class="refsect2" title="gtk.Button.set_use_stock"><a name="method-gtkbutton--set-use-stock"></a><h3>gtk.Button.set_use_stock</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_stock</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_stock</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"><em class="parameter"><code>use_stock</code></em> :</span></p></td><td>If <code class="literal">True</code> the button should use a
stock item</td></tr></tbody></table><p>The <code class="methodname">set_use_stock</code>() method sets the
"use_stock" property to the value of <em class="parameter"><code>use_stock</code></em>. If
<em class="parameter"><code>use_stock</code></em> is <code class="literal">True</code>, the label set
on the button is used as a stock id to select the stock item for the
button.</p></div><div class="refsect2" title="gtk.Button.get_use_stock"><a name="method-gtkbutton--get-use-stock"></a><h3>gtk.Button.get_use_stock</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_stock</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 value of the "use_stock" property.</td></tr></tbody></table><p>The <code class="methodname">get_use_stock</code>() method returns the
value of the "use_stock" property. If <code class="literal">True</code> the button
label is used to select a stock item instead of being used directly as the
label text.</p></div><div class="refsect2" title="gtk.Button.set_focus_on_click"><a name="method-gtkbutton--set-focus-on-click"></a><h3>gtk.Button.set_focus_on_click</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_focus_on_click</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>focus_on_click</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"><em class="parameter"><code>focus_on_click</code></em> :</span></p></td><td>If <code class="literal">True</code> the button grabs focus when
clicked with the mouse.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_focus_on_click</code>() method sets
the "focus-on-click" property to the value of
<em class="parameter"><code>focus_on_click</code></em>. If
<em class="parameter"><code>focus_on_click</code></em> is <code class="literal">True</code>, the button
grabs focus when it is clicked by the mouse.</p></div><div class="refsect2" title="gtk.Button.get_focus_on_click"><a name="method-gtkbutton--get-focus-on-click"></a><h3>gtk.Button.get_focus_on_click</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_focus_on_click</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 value of the "focus-on-click" property.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_focus_on_click</code>() method returns
the value of the "focus-on-click" property. If <code class="literal">True</code> the
button grabs focus when it is clicked by the mouse .</p></div><div class="refsect2" title="gtk.Button.set_alignment"><a name="method-gtkbutton--set-alignment"></a><h3>gtk.Button.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"><em class="parameter"><code>xalign</code></em> :</span></p></td><td>the horizontal alignment of the child widget. The value
ranges from 0.0 to 1.0 and represents the fraction of freespace
to the left of the child widget.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>yalign</code></em> :</span></p></td><td>the vertical alignment of the child widget. The value
ranges from 0.0 to 1.0 and represents the fraction of freespace
above the child widget.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_alignment</code>() method sets the
"xalign" and "yalign" properties to the value of
<em class="parameter"><code>xalign</code></em> and <em class="parameter"><code>yalign</code></em>
respectively. This property has no effect unless the child is a <a class="link" href="class-gtkmisc.html" title="gtk.Misc"><code class="classname">gtk.Misc</code></a> or a <a class="link" href="class-gtkalignment.html" title="gtk.Alignment"><code class="classname">gtk.Alignment</code></a>.</p></div><div class="refsect2" title="gtk.Button.get_alignment"><a name="method-gtkbutton--get-alignment"></a><h3>gtk.Button.get_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_alignment</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>a 2-tuple containing the values of the "xalign" and
"yalign" properties.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_alignment</code>() method returns the
values of the "xalign" and "yalign" properties. See the <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-alignment" title="gtk.Button.set_alignment"><code class="methodname">set_alignment</code>()</a> method for more information.</p></div><div class="refsect2" title="gtk.Button.set_image"><a name="method-gtkbutton--set-image"></a><h3>gtk.Button.set_image</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_image</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>image</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"><em class="parameter"><code>image</code></em> :</span></p></td><td>the widget to set as the image for the button.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">set_image</code>() method sets the "image"
property to the value of <em class="parameter"><code>image</code></em>. This property has no
effect unless the "gtk-button-images" property is
<code class="literal">True</code>. See the <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
reference for more information. Note you do not have to call the <a class="link" href="class-gtkwidget.html#method-gtkwidget--show" title="gtk.Widget.show"><code class="methodname">gtk.Widget.show</code>()</a>
method for <em class="parameter"><code>image</code></em>.</p></div><div class="refsect2" title="gtk.Button.get_image"><a name="method-gtkbutton--get-image"></a><h3>gtk.Button.get_image</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_image</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 <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a> used as
the button image or <code class="literal">None</code> if there is no image.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">get_image</code>() method returns the
value of the "image" property. See the <a class="link" href="class-gtkbutton.html#method-gtkbutton--set-image" title="gtk.Button.set_image"><code class="methodname">set_image</code>()</a>
method for more information.</p></div><div class="refsect2" title="gtk.Button.set_image_position"><a name="method-gtkbutton--set-image-position"></a><h3>gtk.Button.set_image_position</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_image_position</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</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>position</code></strong> :</span></p></td><td>the position of the image relative to the text inside the button.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.10 and above.</p></div><p>The <code class="methodname">set_image_position</code>() method sets the
position of the image relative to the text inside the button. The value of
<em class="parameter"><code>position</code></em> can be one of the <a class="xref" href="gtk-constants.html#gtk-position-type-constants" title="GTK Position Type Constants">GTK Position Type Constants</a>.</p></div><div class="refsect2" title="gtk.Button.get_image_position"><a name="method-gtkbutton--get-image-position"></a><h3>gtk.Button.get_image_position</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_image_position</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 position of the image relative to the text inside the button.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.10 and above.</p></div><p>The <code class="methodname">get_image_position</code>() method returns the
position of the image relative to the text inside the button.</p></div><div class="refsect2" title="gtk.Button.get_event_window"><a name="method-gtkbutton--get-event-window"></a><h3>gtk.Button.get_event_window</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_event_window</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 button's event window if it is realized, <code class="literal">None</code> otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.22 and above.</p></div><p>The <code class="methodname">get_event_window</code>() method returns the
the button's event window if it is realized, <code class="literal">None</code> otherwise.</p></div></div><div class="refsect1" title="Signals"><a name="id3620742"></a><h2>Signals</h2><div class="refsect2" title='The "activate" gtk.Button Signal'><a name="signal-gtkbutton--activate"></a><h3>The "activate" gtk.Button Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>button</code></em> :</span></p></td><td>the button that received the "activate"
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "activate" signal is emitted when the <a class="link" href="class-gtkwidget.html#method-gtkwidget--activate" title="gtk.Widget.activate"><code class="methodname">gtk.Widget.activate</code>()</a>
method is called. For a button it causes the "clicked" signal to be
emitted.</p></div><div class="refsect2" title='The "clicked" gtk.Button Signal'><a name="signal-gtkbutton--clicked"></a><h3>The "clicked" gtk.Button Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>button</code></em> :</span></p></td><td>the button that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "clicked" signal is emitted when the mouse button is pressed
and released while the pointer is over the button or when the button is triggered
with the keyboard.</p></div><div class="refsect2" title='The "enter" gtk.Button Signal'><a name="signal-gtkbutton--enter"></a><h3>The "enter" gtk.Button Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>button</code></em> :</span></p></td><td>the button that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This signal is deprecated since GTK+ 2.8 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--enter-notify-event" title='The "enter-notify-event" gtk.Widget Signal'>enter-notify-event</a>"
signal.</p></div><p>The "enter" signal is emitted when the pointer enters the
button.</p></div><div class="refsect2" title='The "leave" gtk.Button Signal'><a name="signal-gtkbutton--leave"></a><h3>The "leave" gtk.Button Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>button</code></em> :</span></p></td><td>the button that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This signal is deprecated since GTK+ 2.8 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--leave-notify-event" title='The "leave-notify-event" gtk.Widget Signal'>leave-notify-event</a>"
signal.</p></div><p>The "leave" signal is emitted when the pointer leaves the
button.</p></div><div class="refsect2" title='The "pressed" gtk.Button Signal'><a name="signal-gtkbutton--pressed"></a><h3>The "pressed" gtk.Button Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>button</code></em> :</span></p></td><td>the button that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This signal is deprecated since GTK+ 2.8 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--button-press-event" title='The "button-press-event" gtk.Widget Signal'>button-press-event</a>"
signal.</p></div><p>The "pressed" signal is emitted when the mouse button is pressed
while the pointer is over the button.</p></div><div class="refsect2" title='The "released" gtk.Button Signal'><a name="signal-gtkbutton--released"></a><h3>The "released" gtk.Button Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>button</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>button</code></em> :</span></p></td><td>the button that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This signal is deprecated since GTK+ 2.8 and should not be used in newly-written code.
Use the "<a class="link" href="class-gtkwidget.html#signal-gtkwidget--button-release-event" title='The "button-release-event" gtk.Widget Signal'>button-release-event</a>"
signal.</p></div><p>The "released" signal is emitted when the button is released no
matter where the pointer is.</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-gtkbuilder.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-gtkbuttonbox.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Builder </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.ButtonBox</td></tr></table></div></body></html>
|