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
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.ToolButton</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><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="previous" href="class-gtktoolbar.html" title="gtk.Toolbar"><link rel="next" href="class-gtktoolitem.html" title="gtk.ToolItem"></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.ToolButton</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktoolbar.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtktoolitem.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtktoolbutton"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.ToolButton</h2><p>gtk.ToolButton — a <a href="class-gtktoolitem.html" title="gtk.ToolItem"><tt class="classname">gtk.ToolItem</tt></a>
subclass that displays buttons (new in PyGTK 2.4)</p></div><div class="refsect1" lang="en"><a name="id3571270"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ToolButton</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtktoolitem.html" title="gtk.ToolItem">gtk.ToolItem</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtktoolbutton.html#constructor-gtktoolbutton" title="gtk.ToolButton">gtk.ToolButton</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>icon_widget</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="constructorsynopsis"> <span class="methodname"><a href="class-gtktoolbutton.html#constructor-gtktoolbutton2" title="gtk.ToolButton">gtk.ToolButton</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>stock_id</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--set-label" title="gtk.ToolButton.set_label">set_label</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--get-label" title="gtk.ToolButton.get_label">get_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--set-use-underline" title="gtk.ToolButton.set_use_underline">set_use_underline</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>use_underline</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--get-use-underline" title="gtk.ToolButton.get_use_underline">get_use_underline</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--set-stock-id" title="gtk.ToolButton.set_stock_id">set_stock_id</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>stock_id</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--get-stock-id" title="gtk.ToolButton.get_stock_id">get_stock_id</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--set-icon-widget" title="gtk.ToolButton.set_icon_widget">set_icon_widget</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>icon_widget</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--get-icon-widget" title="gtk.ToolButton.get_icon_widget">get_icon_widget</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--set-label-widget" title="gtk.ToolButton.set_label_widget">set_label_widget</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>label_widget</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktoolbutton.html#method-gtktoolbutton--get-label-widget" title="gtk.ToolButton.get_label_widget">get_label_widget</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3571534"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a href="class-gtktoolitem.html" title="gtk.ToolItem">gtk.ToolItem</a>
+-- <a href="class-gtktoolbutton.html" title="gtk.ToolButton">gtk.ToolButton</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3571589"></a><h2>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">"icon-widget"</td><td valign="top">Read-Write</td><td valign="top">The icon widget to display in the item.</td></tr><tr valign="top"><td valign="top">"label"</td><td valign="top">Read-Write</td><td valign="top">The text to show in the item.</td></tr><tr valign="top"><td valign="top">"label-widget"</td><td valign="top">Read-Write</td><td valign="top">The widget to use as the item label instead of
"label".</td></tr><tr valign="top"><td valign="top">"stock-id"</td><td valign="top">Read-Write</td><td valign="top">The stock icon displayed on the item if "label" and
"label-widget" are None.</td></tr><tr valign="top"><td valign="top">"use-underline"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, an underline in the "label"
property indicates that the next character should be used for the mnemonic
accelerator key in the overflow menu.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3571736"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtktoolbutton.html#signal-gtktoolbutton--clicked" title='The "clicked" gtk.ToolButton Signal'>clicked</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>toolbutton</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3571788"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This widget is available in PyGTK 2.4 and above.</p></div><p>A <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
is a sub class of <a href="class-gtktoolitem.html" title="gtk.ToolItem"><tt class="classname">gtk.ToolItem</tt></a> that
contains a button. Use the <a href="class-gtktoolbutton.html#constructor-gtktoolbutton" title="gtk.ToolButton">gtk.ToolButton</a>() constructor to
create a new <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
specifying a widget to use as the icon and a label for the
text. Alternatively use the other <a href="class-gtktoolbutton.html#constructor-gtktoolbutton2" title="gtk.ToolButton">gtk.ToolButton</a>() constructor to
create a <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
from a stock item.</p><p>The label of a <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
is determined by the properties "label_widget", "label", and "stock_id". If
"label_widget" specifies a <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a>, that
widget is used as the label. If "label-widget" is <tt class="literal">None</tt>,
then the string in "label" is used as the label. If both "label-widget" and
"label" are <tt class="literal">None</tt>, the label is determined by the stock
item specified by "stock-id". Finally, if "label-widget", "label" and
"stock-id" are all <tt class="literal">None</tt>, the button does not have a
label.</p><p>The icon of a <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
is determined by the properties "icon-widget" and "stock-id". If
"icon-widget" specifies a <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a>, that
widget is used as the icon. If "icon-widget" is <tt class="literal">None</tt>, the
icon is determined by the stock item specified by "stock-id". If both
"icon-widget" and "stock-id" are <tt class="literal">None</tt>, the button does
not have an icon.</p></div><div class="refsect1" lang="en"><a name="id3571919"></a><h2>Constructor</h2><div class="refsect2" lang="en"><a name="constructor-gtktoolbutton"></a><h3>gtk.ToolButton</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.ToolButton</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>icon_widget</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>icon_widget</tt></b>:</span></td><td>a <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a>
that will be used as the icon widget, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>label</tt></b>:</span></td><td>a string that will be used as the label, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>A new <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
optionally using the icon specified by <i class="parameter"><tt>icon_widget</tt></i>
and the label text specified by <i class="parameter"><tt>label</tt></i>. If both
<i class="parameter"><tt>icon_widget</tt></i> and <i class="parameter"><tt>label</tt></i> are
<tt class="literal">None</tt>, the tool button will be empty.</p></div><div class="refsect2" lang="en"><a name="constructor-gtktoolbutton2"></a><h3>gtk.ToolButton</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.ToolButton</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>stock_id</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>stock_id</tt></b>:</span></td><td>a string that specifies a stock
item</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>A new <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a href="class-gtktoolbutton.html" title="gtk.ToolButton"><tt class="classname">gtk.ToolButton</tt></a>
using the stock item specified by <i class="parameter"><tt>stock_id</tt></i> to
determine the icon and label text. It is an error if
<i class="parameter"><tt>stock_id</tt></i> is not a name of a stock item.</p></div></div><div class="refsect1" lang="en"><a name="id3572180"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtktoolbutton--set-label"></a><h3>gtk.ToolButton.set_label</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_label</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>label</tt></b>:</span></td><td>a string that will be used as label, or
<tt class="literal">None</tt>.</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.4 and above.</p></div><p>The <tt class="methodname">set_label</tt>() method sets the "label"
property to the value of <i class="parameter"><tt>label</tt></i>. If the "label_widget"
property is <tt class="literal">None</tt>, label will be used as the label of the
tool button.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--get-label"></a><h3>gtk.ToolButton.get_label</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_label</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>The label, or
<tt class="literal">None</tt></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.4 and above.</p></div><p>The <tt class="methodname">get_label</tt>() method returns the
value of the "label" property that is used as the label of the tool button
if the "label-widget" property is <tt class="literal">None</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--set-use-underline"></a><h3>gtk.ToolButton.set_use_underline</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_underline</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>use_underline</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>use_underline</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt>, an underline in the
label string specifies a mnemonic key for the overflow
menu</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.4 and above.</p></div><p>The <tt class="methodname">set_use_underline</tt>() method sets the
"use-underline" property to the value of
<i class="parameter"><tt>use_underline</tt></i>. If
<i class="parameter"><tt>use_underline</tt></i> is <tt class="literal">TRUE</tt>, an
underline in the "label" property indicates that the next character should
be used for the mnemonic accelerator key in the overflow menu. For example,
if the label property is "_Open" and <i class="parameter"><tt>use_underline</tt></i> is
<tt class="literal">TRUE</tt>, the label on the tool button will be "Open" and the
item on the overflow menu will have an underlined 'O'. Labels shown on tool
buttons never have mnemonics on them; this property only affects the menu
item on the overflow menu.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--get-use-underline"></a><h3>gtk.ToolButton.get_use_underline</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_underline</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if underscores in the
"label" property are used as mnemonics on menu items on the
overflow menu.</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.4 and above.</p></div><p>The <tt class="methodname">get_use_underline</tt>() method returns
the value of the "use-underline" property. If "use-underline" is
<tt class="literal">TRUE</tt>, underscores in the label property are used as
mnemonics on menu items on the overflow menu. See the <a href="class-gtktoolbutton.html#method-gtktoolbutton--set-use-underline" title="gtk.ToolButton.set_use_underline"><tt class="methodname">set_use_underline()</tt></a>
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--set-stock-id"></a><h3>gtk.ToolButton.set_stock_id</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_stock_id</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>stock_id</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>stock_id</tt></b>:</span></td><td>a name of a stock item, or
<tt class="literal">None</tt></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.4 and above.</p></div><p>The <tt class="methodname">set_stock_id</tt>() method sets the
"stock_id" property to the value of <i class="parameter"><tt>stock_id</tt></i>. The
stock item specified by stock_id is used to determine the icon and label if
not overridden by the "label" and "icon_widget" properties. See the <a href="class-gtktoolbutton.html#constructor-gtktoolbutton2" title="gtk.ToolButton">gtk.ToolButton</a>() constructor for
more information.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--get-stock-id"></a><h3>gtk.ToolButton.get_stock_id</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_stock_id</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the name of the stock item.</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.4 and above.</p></div><p>The <tt class="methodname">get_stock_id</tt>() method returns the
value of the "stock-id" property that contains the name of a stock item or
<tt class="literal">None</tt>. See the <a href="class-gtktoolbutton.html#constructor-gtktoolbutton2" title="gtk.ToolButton">gtk.ToolButton</a>() constructor for
more information.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--set-icon-widget"></a><h3>gtk.ToolButton.set_icon_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_icon_widget</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>icon_widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>icon_widget</tt></b>:</span></td><td>the widget used as icon, or
<tt class="literal">None</tt></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.4 and above.</p></div><p>The <tt class="methodname">set_icon_widget</tt>() method sets the
"icon-widget" property to the value of
<i class="parameter"><tt>icon_widget</tt></i>. If <i class="parameter"><tt>icon_widget</tt></i>
specifies a <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a>, it is
used as the icon of the tool button. If <i class="parameter"><tt>icon_widget</tt></i>
is <tt class="literal">None</tt> the icon is determined by the "stock_id"
property. If the "stock_id" property is also <tt class="literal">None</tt>, the
tool button will not have an icon.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--get-icon-widget"></a><h3>gtk.ToolButton.get_icon_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_icon_widget</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>The widget used as icon on
<i class="parameter"><tt>button</tt></i>, or
<tt class="literal">None</tt>.</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.4 and above.</p></div><p>The <tt class="methodname">get_icon_widget</tt>() method returns
the value of the "icon-widget" property that contains the <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a> used as
the icon on the tool button. See the <a href="class-gtktoolbutton.html#method-gtktoolbutton--set-icon-widget" title="gtk.ToolButton.set_icon_widget"><tt class="methodname">set_icon_widget()</tt></a>
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--set-label-widget"></a><h3>gtk.ToolButton.set_label_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_label_widget</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>label_widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>label_widget</tt></b>:</span></td><td>the widget used as the label, or
<tt class="literal">None</tt></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.4 and above.</p></div><p>The <tt class="methodname">set_label_widget</tt>() method sets the
"label-widget" property to the <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a> specified
by <i class="parameter"><tt>label_widget</tt></i> that will be used as the label for
the tool button. If <i class="parameter"><tt>label_widget</tt></i> is
<tt class="literal">None</tt> the "label" property is used as label. If
"label-widget" and "label" are both <tt class="literal">None</tt>, the label in
the stock item determined by the "stock_id" property is used as the
label. If "label-widget", "label" and "stock_id" are all
<tt class="literal">None</tt>, the tool button will not have a label.</p></div><div class="refsect2" lang="en"><a name="method-gtktoolbutton--get-label-widget"></a><h3>gtk.ToolButton.get_label_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_label_widget</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>The widget used as label on
<i class="parameter"><tt>button</tt></i>, or
<tt class="literal">None</tt>.</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.4 and above.</p></div><p>The <tt class="methodname">get_label_widget</tt>() method returns
the value of the "label-widget" property that is used as the label on the
tool button. See the <a href="class-gtktoolbutton.html#method-gtktoolbutton--set-label-widget" title="gtk.ToolButton.set_label_widget"><tt class="methodname">gtk.ToolButton.set_label_widget()</tt></a>
method for more information.</p></div></div><div class="refsect1" lang="en"><a name="id3573036"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtktoolbutton--clicked"></a><h3>The "clicked" gtk.ToolButton Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>toolbutton</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>toolbutton</tt></i>:</span></td><td>the toolbutton that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "clicked" signal is emitted when the tool button is clicked
with the mouse or activated with the keyboard.</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-gtktoolbar.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-gtktoolitem.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Toolbar</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.ToolItem</td></tr></table></div></body></html>
|