/usr/share/gtk-doc/html/pygtk/class-gtkaction.html is in python-gtk2-doc 2.24.0-4.
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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Action</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-gtkaccessible.html" title="gtk.Accessible"><link rel="next" href="class-gtkactiongroup.html" title="gtk.ActionGroup"></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.Action</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkaccessible.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkactiongroup.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.Action"><a name="class-gtkaction"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Action</h2><p>gtk.Action — an action which can be triggered by a menu or toolbar
item (new in PyGTK 2.4)</p></div><div class="refsect1" title="Synopsis"><a name="id2936400"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Action</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkaction.html#constructor-gtkaction" title="Constructor">gtk.Action</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>tooltip</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock_id</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--activate" title="gtk.Action.activate">activate</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--block-activate" title="gtk.Action.block_activate">block_activate</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--block-activate-from" title="gtk.Action.block_activate_from">block_activate_from</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--connect-accelerator" title="gtk.Action.connect_accelerator">connect_accelerator</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--connect-proxy" title="gtk.Action.connect_proxy">connect_proxy</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--create-icon" title="gtk.Action.create_icon">create_icon</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon_size</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--create-menu" title="gtk.Action.create_menu">create_menu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--create-menu-item" title="gtk.Action.create_menu_item">create_menu_item</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--create-tool-item" title="gtk.Action.create_tool_item">create_tool_item</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--disconnect-accelerator" title="gtk.Action.disconnect_accelerator">disconnect_accelerator</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--disconnect-proxy" title="gtk.Action.disconnect_proxy">disconnect_proxy</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-accel-path" title="gtk.Action.get_accel_path">get_accel_path</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-gicon" title="gtk.Action.get_gicon">get_gicon</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-icon-name" title="gtk.Action.get_icon_name">get_icon_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-is-important" title="gtk.Action.get_is_important">get_is_important</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-label" title="gtk.Action.get_label">get_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-name" title="gtk.Action.get_name">get_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-proxies" title="gtk.Action.get_proxies">get_proxies</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-visible" title="gtk.Action.get_visible">get_visible</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-short-label" title="gtk.Action.get_short_label">get_short_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-sensitive" title="gtk.Action.get_sensitive">get_sensitive</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-stock-id" title="gtk.Action.get_stock_id">get_stock_id</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-tooltip" title="gtk.Action.get_tooltip">get_tooltip</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-visible-horizontal" title="gtk.Action.get_visible_horizontal">get_visible_horizontal</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-visible-vertical" title="gtk.Action.get_visible_vertical">get_visible_vertical</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--is-sensitive" title="gtk.Action.is_sensitive">is_sensitive</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--is-visible" title="gtk.Action.is_visible">is_visible</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--get-always-show-image" title="gtk.Action.get_always_show_image">get_always_show_image</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-always-show-image" title="gtk.Action.set_always_show_image">set_always_show_image</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>always_show</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-accel-group" title="gtk.Action.set_accel_group">set_accel_group</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-accel-path" title="gtk.Action.set_accel_path">set_accel_path</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_path</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-gicon" title="gtk.Action.set_gicon">set_gicon</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-icon-name" title="gtk.Action.set_icon_name">set_icon_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon_name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-is-important" title="gtk.Action.set_is_important">set_is_important</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>is_important</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-label" title="gtk.Action.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-gtkaction.html#method-gtkaction--set-menu-item-type" title="gtk.Action.set_menu_item_type">set_menu_item_type</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-sensitive" title="gtk.Action.set_sensitive">set_sensitive</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>sensitive</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-short-label" title="gtk.Action.set_short_label">set_short_label</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>short_label</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-stock-id" title="gtk.Action.set_stock_id">set_stock_id</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock_id</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-tool-item-type" title="gtk.Action.set_tool_item_type">set_tool_item_type</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-tooltip" title="gtk.Action.set_tooltip">set_tooltip</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tooltip</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-visible-horizontal" title="gtk.Action.set_visible_horizontal">set_visible_horizontal</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible_horizontal</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-visible-vertical" title="gtk.Action.set_visible_vertical">set_visible_vertical</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible_vertical</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--set-visible" title="gtk.Action.set_visible">set_visible</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--unblock-activate" title="gtk.Action.unblock_activate">unblock_activate</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--unblock-activate-from" title="gtk.Action.unblock_activate_from">unblock_activate_from</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id2902118"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkaction.html" title="gtk.Action">gtk.Action</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id2999566"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</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.Action Properties"><a name="properties-gtkaction"></a><h2>gtk.Action 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 width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"action-group"</td><td valign="top">Read-Write</td><td valign="top">The <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>
this <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> is
associated with, or <code class="literal">None</code> (for internal use).</td></tr><tr valign="top"><td valign="top">"always-show-image"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the action's menu item proxies will ignore the "gtk-menu-images"
setting and always show their image, if available. Use this if the menu item would be useless or
hard to use without their image.</td></tr><tr valign="top"><td valign="top">"hide-if-empty"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, empty menu proxies for this
action are hidden.</td></tr><tr valign="top"><td valign="top">"gicon"</td><td valign="top">Read-Write</td><td valign="top">
The <PYGTKDOCLINK HREF="class-gioicon"><code class="classname">gio.Icon</code></PYGTKDOCLINK> displayed in the
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>.
Note that the stock icon is preferred, if the "stock-id" property holds the id of an existing stock icon.
This is an appearance property and thus only applies if "use-action-appearance" is <code class="literal">True</code>.
This property is available in GTK+ 2.16 and above.
</td></tr><tr valign="top"><td valign="top">"icon-name"</td><td valign="top">Read-Write</td><td valign="top">
The name of the icon from the icon theme.
Note that the stock icon is preferred, if the "stock-id" property holds the id of an existing stock icon
and the <PYGTKDOCLINK HREF="class-gioicon"><code class="classname">gio.Icon</code></PYGTKDOCLINK> is preferred if
the "gicon" property is set.
This is an appearance property and thus only applies if "use-action-appearance" is <code class="literal">True</code>.
This property is available in GTK+ 2.10 and above.
</td></tr><tr valign="top"><td valign="top">"is-important"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, <a class="link" href="class-gtktoolitem.html" title="gtk.ToolItem"><code class="classname">gtk.ToolItem</code></a>
proxies for this action show text in
<code class="literal">gtk.TOOLBAR_BOTH_HORIZ</code> mode.</td></tr><tr valign="top"><td valign="top">"label"</td><td valign="top">Read-Write</td><td valign="top">The label used for menu items and buttons that activate
this action.</td></tr><tr valign="top"><td valign="top">"name"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">A unique name for the action.</td></tr><tr valign="top"><td valign="top">"sensitive"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the action is
enabled.</td></tr><tr valign="top"><td valign="top">"short-label"</td><td valign="top">Read-Write</td><td valign="top">A shorter label that may be used on toolbar
buttons.</td></tr><tr valign="top"><td valign="top">"stock-id"</td><td valign="top">Read-Write</td><td valign="top">The stock icon displayed in widgets representing this
action.</td></tr><tr valign="top"><td valign="top">"tooltip"</td><td valign="top">Read-Write</td><td valign="top">A tooltip for this action.</td></tr><tr valign="top"><td valign="top">"visible"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the action is
visible.</td></tr><tr valign="top"><td valign="top">"visible-horizontal"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the toolbar item is
visible when the toolbar is in a horizontal orientation.</td></tr><tr valign="top"><td valign="top">"visible-overflown"</td><td valign="top">Read-Write</td><td valign="top">
If <code class="literal">True</code>, toolitem proxies for this
action are represented in the toolbar overflow menu.
This property is available in GTK+ 2.6 and above.
</td></tr><tr valign="top"><td valign="top">"visible-vertical"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the toolbar item is
visible when the toolbar is in a vertical orientation.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.Action Signal Prototypes"><a name="signal-prototypes-gtkaction"></a><h2>gtk.Action Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></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-gtkaction.html#signal-gtkaction--activate" title='The "activate" gtk.Action 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>action</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="id2988798"></a><h2>Description</h2><div class="note" title="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 class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
represents operations that the user can perform, along with some information
how it should be presented in the interface. Each <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> provides
methods to create icons, menu items and toolbar items representing
itself.</p><p>As well as the callback that is called when the action gets
activated, the following also gets associated with the action:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">a name (not translated, for path lookup)</li><li class="listitem">a label (translated, for display)</li><li class="listitem">an accelerator</li><li class="listitem">whether the label indicates a stock id</li><li class="listitem">a tooltip (optional, translated)</li><li class="listitem">a toolbar label (optional, shorter than label)</li></ul></div><p>The action will also have some state information:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">visible (shown/hidden)</li><li class="listitem">sensitive (enabled/disabled)</li></ul></div><p>Apart from regular actions, there are toggle actions, which can be
toggled between two states and radio actions, where only one in a group
can be in the "active" state. Other actions can be implemented as <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
subclasses.</p><p>Each <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> can have
one or more proxy menu items, toolbar buttons or other proxy
widgets. Proxies mirror the state of the action (text label, tooltip, icon,
visible, sensitive, etc), and should change when the action's state
changes. When the proxy is activated, it should activate its action. </p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkaction"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.Action</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>tooltip</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock_id</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>name</code></strong> :</span></p></td><td>a unique name for the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>label</code></strong> :</span></p></td><td>the label displayed in menu items and on
buttons</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>tooltip</code></strong> :</span></p></td><td>a tooltip for the action</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>stock_id</code></strong> :</span></p></td><td>the stock icon to display in widgets
representing the action</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a></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 constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
object. To add the action to a <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>
and set the accelerator for the action, call the <a class="link" href="class-gtkactiongroup.html#method-gtkactiongroup--add-action-with-accel" title="gtk.ActionGroup.add_action_with_accel"><code class="methodname">gtk.ActionGroup.add_action_with_accel()</code></a>.</p></div><div class="refsect1" title="Methods"><a name="id2922846"></a><h2>Methods</h2><div class="refsect2" title="gtk.Action.block_activate"><a name="method-gtkaction--block-activate"></a><h3>gtk.Action.block_activate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">block_activate</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody></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.16 and above.</p></div><p>
The <code class="methodname">block_activate</code>() method disable activation signals from the action
</p><p>
This is needed when updating the state of your proxy
<a class="link" href="class-gtkactivatable.html" title="gtk.Activatable"><code class="classname">gtk.Activatable</code></a>
widget could result in calling
<code class="methodname"><a class="link" href="class-gtkaction.html#method-gtkaction--activate" title="gtk.Action.activate">gtk.Action.activate</a></code>(),
this is a convenience function to avoid recursing in those cases (updating toggle state for instance).
</p></div><div class="refsect2" title="gtk.Action.get_gicon"><a name="method-gtkaction--get-gicon"></a><h3>gtk.Action.get_gicon</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_gicon</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 action's <PYGTKDOCLINK HREF="class-gioicon"><code class="classname">gio.Icon</code></PYGTKDOCLINK>
if one is set.</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.16 and above.</p></div><p>
The <code class="methodname">get_gicon</code>() method gets the
<PYGTKDOCLINK HREF="class-gioicon"><code class="classname">gio.Icon</code></PYGTKDOCLINK> of action.
</p></div><div class="refsect2" title="gtk.Action.get_icon_name"><a name="method-gtkaction--get-icon-name"></a><h3>gtk.Action.get_icon_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_icon_name</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 icon name.
</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.16 and above.</p></div><p>
The <code class="methodname">get_icon_name</code>() method gets the icon name
of action.
</p></div><div class="refsect2" title="gtk.Action.get_is_important"><a name="method-gtkaction--get-is-important"></a><h3>gtk.Action.get_is_important</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_is_important</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>whether action is important, returning
<code class="literal">True</code> if it is.
</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.16 and above.</p></div><p>
The <code class="methodname">get_is_important</code>() method checks whether
action is important or not.
</p></div><div class="refsect2" title="gtk.Action.get_label"><a name="method-gtkaction--get-label"></a><h3>gtk.Action.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 label text.
</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.16 and above.</p></div><p>
The <code class="methodname">get_label</code>() method gets the label text of action.
</p></div><div class="refsect2" title="gtk.Action.get_name"><a name="method-gtkaction--get-name"></a><h3>gtk.Action.get_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_name</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 name of the action.</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_name</code>() method returns the value
of the "name" property containing the name of the action.</p></div><div class="refsect2" title="gtk.Action.get_short_label"><a name="method-gtkaction--get-short-label"></a><h3>gtk.Action.get_short_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_short_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 short label text.
</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.16 and above.</p></div><p>
The <code class="methodname">get_short_label</code>() method gets the short label text of action.
</p></div><div class="refsect2" title="gtk.Action.get_tooltip"><a name="method-gtkaction--get-tooltip"></a><h3>gtk.Action.get_tooltip</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_tooltip</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 tooltip text.
</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.16 and above.</p></div><p>
The <code class="methodname">get_tooltip</code>() method gets the tooltip text of action.
</p></div><div class="refsect2" title="gtk.Action.get_visible_horizontal"><a name="method-gtkaction--get-visible-horizontal"></a><h3>gtk.Action.get_visible_horizontal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_visible_horizontal</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>whether action is visible when horizontal.
</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.16 and above.</p></div><p>
The <code class="methodname">get_visible_horizontal</code>() method gets whether
action is visible when horizontal
</p></div><div class="refsect2" title="gtk.Action.get_visible_vertical"><a name="method-gtkaction--get-visible-vertical"></a><h3>gtk.Action.get_visible_vertical</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_visible_vertical</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>whether action is visible when vertical.
</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.16 and above.</p></div><p>
The <code class="methodname">get_visible_vertical</code>() method gets whether
action is visible when vertical.
</p></div><div class="refsect2" title="gtk.Action.get_stock_id"><a name="method-gtkaction--get-stock-id"></a><h3>gtk.Action.get_stock_id</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_stock_id</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 stock id.
</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.16 and above.</p></div><p>
The <code class="methodname">get_stock_id</code>() method gets the stock id of action.
</p></div><div class="refsect2" title="gtk.Action.is_sensitive"><a name="method-gtkaction--is-sensitive"></a><h3>gtk.Action.is_sensitive</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">is_sensitive</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 the action and its
associated action group are both sensitive.</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">is_sensitive</code>() method returns
<code class="literal">True</code> if the action is effectively sensitive i.e. both the
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> and
its associated <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>
are sensitive.</p></div><div class="refsect2" title="gtk.Action.get_sensitive"><a name="method-gtkaction--get-sensitive"></a><h3>gtk.Action.get_sensitive</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_sensitive</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 the action itself
is sensitive.</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_sensitive</code>() method returns the
value of the "sensitive" property. If "sensitive" is <code class="literal">True</code>
the action itself is sensitive. Note that this doesn't necessarily mean
effective sensitivity. See the <a class="link" href="class-gtkaction.html#method-gtkaction--is-sensitive" title="gtk.Action.is_sensitive"><code class="methodname">is_sensitive()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.Action.is_visible"><a name="method-gtkaction--is-visible"></a><h3>gtk.Action.is_visible</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">is_visible</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 the action and
its associated action group are both visible.</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">is_visible</code>() method returns
<code class="literal">True</code> if the action is effectively visible i.e. both the
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> and
its associated <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>
as visible.</p></div><div class="refsect2" title="gtk.Action.get_visible"><a name="method-gtkaction--get-visible"></a><h3>gtk.Action.get_visible</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_visible</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 the action itself
is visible.</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_visible</code>() method returns the
value of the "visible" property. If "visible" is <code class="literal">True</code> the
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
itself is visible. Note that this doesn't necessarily mean effective
visibility. See the <a class="link" href="class-gtkaction.html#method-gtkaction--is-visible" title="gtk.Action.is_visible"><code class="methodname">is_visible()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.Action.activate"><a name="method-gtkaction--activate"></a><h3>gtk.Action.activate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">activate</span>(<span class="methodparam"></span>)</code></pre><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">activate</code>() method emits the
"activate" signal on the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>, if it
isn't insensitive. This gets called by the proxy widgets when they get
activated. It can also be used to manually activate an action.</p></div><div class="refsect2" title="gtk.Action.create_icon"><a name="method-gtkaction--create-icon"></a><h3>gtk.Action.create_icon</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">create_icon</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon_size</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>icon_size</code></strong> :</span></p></td><td>the size of the icon that should be
created.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a widget that displays the icon for this
action.</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">create_icon</code>() method creates and
returns a <a class="link" href="class-gtkimage.html" title="gtk.Image"><code class="classname">gtk.Image</code></a> with the
size specified by <em class="parameter"><code>size</code></em> from the icon contained in the
"stock-id" property if it exists. The value of <em class="parameter"><code>size</code></em>
must be one of:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><code class="literal">gtk.ICON_SIZE_MENU</code></li><li class="listitem"><code class="literal">gtk.ICON_SIZE_SMALL_TOOLBAR</code></li><li class="listitem"><code class="literal">gtk.ICON_SIZE_LARGE_TOOLBAR</code></li><li class="listitem"><code class="literal">gtk.ICON_SIZE_BUTTON</code></li><li class="listitem"><code class="literal">gtk.ICON_SIZE_DND</code></li><li class="listitem"><code class="literal">gtk.ICON_SIZE_DIALOG</code></li></ul></div><p>This method is intended for use by <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
implementations to create icons displayed in the proxy widgets.</p></div><div class="refsect2" title="gtk.Action.create_menu"><a name="method-gtkaction--create-menu"></a><h3>gtk.Action.create_menu</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">create_menu</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 menu item provided by the action, or
<code class="literal">None</code>.</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.12 and above.</p></div><p>
If action provides a <a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a>.
widget as a submenu for the menu item or the toolbar item it creates, <code class="methodname">create_menu</code>() method
returns an instance of that menu.
</p></div><div class="refsect2" title="gtk.Action.create_menu_item"><a name="method-gtkaction--create-menu-item"></a><h3>gtk.Action.create_menu_item</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">create_menu_item</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 menu item connected to the
action.</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">create_menu_item</code>() method creates
and returns a menu item widget that proxies for the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>.</p></div><div class="refsect2" title="gtk.Action.create_tool_item"><a name="method-gtkaction--create-tool-item"></a><h3>gtk.Action.create_tool_item</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">create_tool_item</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 tool item connected to the
action.</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">create_tool_item</code>() method creates
and returns a tool item widget that proxies for the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>.</p></div><div class="refsect2" title="gtk.Action.connect_proxy"><a name="method-gtkaction--connect-proxy"></a><h3>gtk.Action.connect_proxy</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">connect_proxy</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</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>proxy</code></strong> :</span></p></td><td>the proxy 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">connect_proxy</code>() method connects the
widget specified by <em class="parameter"><code>proxy</code></em> to the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> object as
a proxy. This method synchronizes various properties of the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> with the
widget (such as label text, icon, tooltip, etc), and attaches a callback so
that the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> is
activated when <em class="parameter"><code>proxy</code></em> is.</p><p>If <em class="parameter"><code>proxy</code></em> is already connected to another
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>, it
is disconnected first. The <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> should be
added to a <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>
before calling this method.</p></div><div class="refsect2" title="gtk.Action.disconnect_proxy"><a name="method-gtkaction--disconnect-proxy"></a><h3>gtk.Action.disconnect_proxy</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">disconnect_proxy</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</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>proxy</code></strong> :</span></p></td><td>the proxy 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">disconnect_proxy</code>() method
disconnects the widget specified by <em class="parameter"><code>proxy</code></em> from the
<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>. This
method does <span class="emphasis"><em>not</em></span> destroy the widget. The <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> should be
added to a <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>
before calling this method.</p></div><div class="refsect2" title="gtk.Action.get_proxies"><a name="method-gtkaction--get-proxies"></a><h3>gtk.Action.get_proxies</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_proxies</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 list of proxy widgets.</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_proxies</code>() method returns a list
containing the proxy widgets associated with the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>.</p></div><div class="refsect2" title="gtk.Action.connect_accelerator"><a name="method-gtkaction--connect-accelerator"></a><h3>gtk.Action.connect_accelerator</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">connect_accelerator</span>(<span class="methodparam"></span>)</code></pre><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">connect_accelerator</code>() method
installs the accelerator for the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> if it has
an associated accel path and <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>. See
the <a class="link" href="class-gtkaction.html#method-gtkaction--set-accel-path" title="gtk.Action.set_accel_path"><code class="methodname">set_accel_path()</code></a>
and the <a class="link" href="class-gtkaction.html#method-gtkaction--set-accel-group" title="gtk.Action.set_accel_group"><code class="methodname">set_accel_group()</code></a>
methods.</p><p>Since multiple proxies may independently trigger the
installation of the accelerator, the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> counts
the number of times this method has been called and doesn't remove the
accelerator until <a class="link" href="class-gtkaction.html#method-gtkaction--disconnect-accelerator" title="gtk.Action.disconnect_accelerator"><code class="methodname">disconnect_accelerator()</code></a>
has been called as many times.</p></div><div class="refsect2" title="gtk.Action.disconnect_accelerator"><a name="method-gtkaction--disconnect-accelerator"></a><h3>gtk.Action.disconnect_accelerator</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">disconnect_accelerator</span>(<span class="methodparam"></span>)</code></pre><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">disconnect_accelerator</code>() method
undoes the effect of one call to the <a class="link" href="class-gtkaction.html#method-gtkaction--connect-accelerator" title="gtk.Action.connect_accelerator"><code class="methodname">connect_accelerator()</code></a>
method.</p></div><div class="refsect2" title="gtk.Action.block_activate_from"><a name="method-gtkaction--block-activate-from"></a><h3>gtk.Action.block_activate_from</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">block_activate_from</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</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>proxy</code></strong> :</span></p></td><td>a proxy 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">block_activate_from</code>() method
disables calls to the <a class="link" href="class-gtkaction.html#method-gtkaction--activate" title="gtk.Action.activate"><code class="methodname">activate()</code></a>
method by signals on the widget specified by
<em class="parameter"><code>proxy</code></em>. This is used to break notification loops for
things like check or radio actions.</p><p>This method is intended for use by <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
implementations.</p></div><div class="refsect2" title="gtk.Action.unblock_activate_from"><a name="method-gtkaction--unblock-activate-from"></a><h3>gtk.Action.unblock_activate_from</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unblock_activate_from</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>proxy</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>proxy</code></strong> :</span></p></td><td>a proxy 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">unblock_activate_from</code>() method
re-enables calls to the <a class="link" href="class-gtkaction.html#method-gtkaction--activate" title="gtk.Action.activate"><code class="methodname">activate()</code></a>
method by signals on the widget specified by <em class="parameter"><code>proxy</code></em>.
This undoes the blocking done by the <a class="link" href="class-gtkaction.html#method-gtkaction--block-activate-from" title="gtk.Action.block_activate_from"><code class="methodname">block_activate_from()</code></a>
method.</p><p>This method is intended for use by <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>
implementations.</p></div><div class="refsect2" title="gtk.Action.get_accel_path"><a name="method-gtkaction--get-accel-path"></a><h3>gtk.Action.get_accel_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_accel_path</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 accelerator path associated with the action
or <code class="literal">None</code></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_accel_path</code>() method returns the
accel path for the action or <code class="literal">None</code> if no accel path is
set.</p></div><div class="refsect2" title="gtk.Action.set_accel_path"><a name="method-gtkaction--set-accel-path"></a><h3>gtk.Action.set_accel_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_accel_path</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_path</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>accel_path</code></strong> :</span></p></td><td>the accelerator path</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_accel_path</code>() method sets the
accel path for the action to the value of
<em class="parameter"><code>accel_path</code></em>. All proxy widgets associated with the
action will have this accel path, so that their accelerators are
consistent.</p></div><div class="refsect2" title="gtk.Action.get_always_show_image"><a name="method-gtkaction--get-always-show-image"></a><h3>gtk.Action.get_always_show_image</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_always_show_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>Returns <code class="literal">True</code> if the action's menu item proxies always show their image, <code class="literal">False</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_always_show_image</code>() method returns whether the action's
menu item proxies will ignore the "gtk-menu-images" setting and always show their image, if available.</p></div><div class="refsect2" title="gtk.Action.set_always_show_image"><a name="method-gtkaction--set-always-show-image"></a><h3>gtk.Action.set_always_show_image</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_always_show_image</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>always_show</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>always_show</code></em> :</span></p></td><td>If <code class="literal">True</code> the action's menu item proxies will always show their 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.22 and above.</p></div><p>The <code class="methodname">set_always_show_image</code>() method sets whether the action's
menu item proxies will ignore the "gtk-menu-images" setting and always show their image, if available.
Use this if the menu item would be useless or hard to use without their image.</p></div><div class="refsect2" title="gtk.Action.set_accel_group"><a name="method-gtkaction--set-accel-group"></a><h3>gtk.Action.set_accel_group</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_accel_group</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</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>accel_group</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a> or <code class="literal">None</code></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_accel_group</code>() method sets the
<a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
specified by <em class="parameter"><code>accel_group</code></em> as the accelerator group for
the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>.</p></div><div class="refsect2" title="gtk.Action.set_gicon"><a name="method-gtkaction--set-gicon"></a><h3>gtk.Action.set_gicon</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_gicon</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon</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>icon</code></strong> :</span></p></td><td>the <PYGTKDOCLINK HREF="class-gioicon"><code class="classname">gio.Icon</code></PYGTKDOCLINK> to set .
</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.16 and above.</p></div><p>
The <code class="methodname">set_gicon</code>() method sets the icon of action.
</p></div><div class="refsect2" title="gtk.Action.set_icon_name"><a name="method-gtkaction--set-icon-name"></a><h3>gtk.Action.set_icon_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_icon_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon_name</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>icon_name</code></strong> :</span></p></td><td>the icon name to set.
</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.16 and above.</p></div><p>
The <code class="methodname">set_icon_name</code>() method sets the icon name on action.
</p></div><div class="refsect2" title="gtk.Action.set_is_important"><a name="method-gtkaction--set-is-important"></a><h3>gtk.Action.set_is_important</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_is_important</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>is_important</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>is_important</code></strong> :</span></p></td><td><code class="literal">True</code> to make the action important
</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.16 and above.</p></div><p>
The <code class="methodname">set_is_important</code>() method sets whether the action is important,
this attribute is used primarily by toolbar items to decide whether to show a label or not.
</p></div><div class="refsect2" title="gtk.Action.set_label"><a name="method-gtkaction--set-label"></a><h3>gtk.Action.set_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_label</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</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>label</code></strong> :</span></p></td><td>the label text to set.
</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.16 and above.</p></div><p>
The <code class="methodname">set_is_important</code>() method sets the label of action.
</p></div><div class="refsect2" title="gtk.Action.set_short_label"><a name="method-gtkaction--set-short-label"></a><h3>gtk.Action.set_short_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_short_label</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>short_label</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>short_label</code></strong> :</span></p></td><td>the short label text to set.
</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.16 and above.</p></div><p>
The <code class="methodname">set_short_label</code>() method sets the short label of action.
</p></div><div class="refsect2" title="gtk.Action.set_sensitive"><a name="method-gtkaction--set-sensitive"></a><h3>gtk.Action.set_sensitive</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_sensitive</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>sensitive</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>sensitive</code></strong> :</span></p></td><td>if <code class="literal">True</code> make the action
sensitive</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_sensitive</code>() method sets the
"sensitive" property to the value of <em class="parameter"><code>sensitive</code></em>. Note
that this doesn't necessarily set the effective sensitivity. See the <a class="link" href="class-gtkaction.html#method-gtkaction--is-sensitive" title="gtk.Action.is_sensitive"><code class="methodname">is_sensitive</code>()</a>
method for more information.</p></div><div class="refsect2" title="gtk.Action.set_stock_id"><a name="method-gtkaction--set-stock-id"></a><h3>gtk.Action.set_stock_id</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_stock_id</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock_id</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>stock_id</code></strong> :</span></p></td><td>the stock id.
</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.16 and above.</p></div><p>
The <code class="methodname">set_stock_id</code>() method sets the stock id on action
</p></div><div class="refsect2" title="gtk.Action.set_tooltip"><a name="method-gtkaction--set-tooltip"></a><h3>gtk.Action.set_tooltip</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_tooltip</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tooltip</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>tooltip</code></strong> :</span></p></td><td>the tooltip text.
</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.16 and above.</p></div><p>
The <code class="methodname">set_tooltip</code>() method sets the tooltip text on action.
</p></div><div class="refsect2" title="gtk.Action.set_visible"><a name="method-gtkaction--set-visible"></a><h3>gtk.Action.set_visible</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</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>visible</code></strong> :</span></p></td><td>if <code class="literal">True</code> make the action
visible</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_visible</code>() method sets the
"visible" property to the value of <em class="parameter"><code>visible</code></em>. Note that
this doesn't necessarily set the effective visibility. See the <a class="link" href="class-gtkaction.html#method-gtkaction--is-visible" title="gtk.Action.is_visible"><code class="methodname">is_visible</code>()</a>
method for more information.</p></div><div class="refsect2" title="gtk.Action.set_visible_horizontal"><a name="method-gtkaction--set-visible-horizontal"></a><h3>gtk.Action.set_visible_horizontal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_horizontal</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible_horizontal</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>visible_horizontal</code></strong> :</span></p></td><td>whether the action is visible horizontally.
</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.16 and above.</p></div><p>
The <code class="methodname">set_visible_horizontal</code>() method sets whether action
is visible when horizontal
</p></div><div class="refsect2" title="gtk.Action.set_visible_vertical"><a name="method-gtkaction--set-visible-vertical"></a><h3>gtk.Action.set_visible_vertical</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_vertical</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible_vertical</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>visible_vertical</code></strong> :</span></p></td><td>whether the action is visible vertically.
</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.16 and above.</p></div><p>
The <code class="methodname">set_visible_vertical</code>() method sets whether action
is visible when vertical
</p></div><div class="refsect2" title="gtk.Action.set_menu_item_type"><a name="method-gtkaction--set-menu-item-type"></a><h3>gtk.Action.set_menu_item_type</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_menu_item_type</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</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>type</code></strong> :</span></p></td><td>the type of menuitem to be created for the
action</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_menu_item_type</code>() method is a
classmethod that sets the type of menuitem to be created for the
action to that specified by <em class="parameter"><code>type</code></em>. This is
useful when using the <a class="link" href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a>
and you would like to use something other than a <a class="link" href="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem"><code class="classname">gtk.ImageMenuItem</code></a>
(<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>) or
a <a class="link" href="class-gtkcheckmenuitem.html" title="gtk.CheckMenuItem"><code class="classname">gtk.CheckMenuItem</code></a>
(<PYGTKDOCLINK HREF="class-gtktoogleaction"><code class="classname">gtk.ToogleAction</code></PYGTKDOCLINK>
or <a class="link" href="class-gtkradioaction.html" title="gtk.RadioAction"><code class="classname">gtk.RadioAction</code></a>).</p></div><div class="refsect2" title="gtk.Action.set_tool_item_type"><a name="method-gtkaction--set-tool-item-type"></a><h3>gtk.Action.set_tool_item_type</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_tool_item_type</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</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>type</code></strong> :</span></p></td><td>the type of toolitem to be created for the
action</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_tool_item_type</code>() method is a
classmethod that sets the type of toolitem to be created for the
action to that specified by <em class="parameter"><code>type</code></em>. This is
useful when using the <a class="link" href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a>
and you would like to use something other than a <a class="link" href="class-gtktoolbutton.html" title="gtk.ToolButton"><code class="classname">gtk.ToolButton</code></a>
(<a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>) or
a <a class="link" href="class-gtktoggletoolbutton.html" title="gtk.ToggleToolButton"><code class="classname">gtk.ToggleToolButton</code></a>
(<PYGTKDOCLINK HREF="class-gtktoogleaction"><code class="classname">gtk.ToogleAction</code></PYGTKDOCLINK>
or <a class="link" href="class-gtkradioaction.html" title="gtk.RadioAction"><code class="classname">gtk.RadioAction</code></a>).</p><p>For example, to use a <a class="link" href="class-gtkmenutoolbutton.html" title="gtk.MenuToolButton"><code class="classname">gtk.MenuToolButton</code></a>
in a toolbar you would subclass <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a>:</p><pre class="programlisting">
class MenuToolAction(gtk.Action):
__gtype_name__ = "MenuToolAction"
gobject.type_register(MenuToolAction)
</pre><p>and then call <a class="link" href="class-gtkaction.html#method-gtkaction--set-tool-item-type" title="gtk.Action.set_tool_item_type"><code class="methodname">set_tool_item_type</code>()</a>:</p><pre class="programlisting">
MenuToolAction.set_tool_item_type(gtk.MenuToolButton)
</pre><p>You have to create, name and add an instance of
<em class="parameter"><code>MenuToolAction</code></em> to your <a class="link" href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a>:</p><pre class="programlisting">
actiongroup.add_action(MenuToolAction("my_menutoolaction", "_MTB_label",
"do something", None))
</pre><p>The ui description should reference the
<em class="parameter"><code>MenuToolAction</code></em> like:</p><pre class="programlisting">
<toolitem action="my_menutoolaction"/>
</pre><p>After the <a class="link" href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a>
creates the toolbar including the <a class="link" href="class-gtkmenutoolbutton.html" title="gtk.MenuToolButton"><code class="classname">gtk.MenuToolButton</code></a>
proxy for the <em class="parameter"><code>MenuToolAction</code></em>, you would have to
create and add a menu to the <a class="link" href="class-gtkmenutoolbutton.html" title="gtk.MenuToolButton"><code class="classname">gtk.MenuToolButton</code></a>
instance.</p><p>This technique can be extended by subclassing <a class="link" href="class-gtktoolitem.html" title="gtk.ToolItem"><code class="classname">gtk.ToolItem</code></a>
and adding custom widgets to it.</p></div><div class="refsect2" title="gtk.Action.unblock_activate"><a name="method-gtkaction--unblock-activate"></a><h3>gtk.Action.unblock_activate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unblock_activate</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody></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.16 and above.</p></div><p>
The <code class="methodname">unblock_activate</code>() method reenables activation
signals from the action.
</p></div></div><div class="refsect1" title="Signals"><a name="id2984993"></a><h2>Signals</h2><div class="refsect2" title='The "activate" gtk.Action Signal'><a name="signal-gtkaction--activate"></a><h3>The "activate" gtk.Action Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>action</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>action</code></em> :</span></p></td><td>the <a class="link" href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> 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="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in PyGTK 2.4 and above.</p></div><p>The "activate" signal is emitted when
<em class="parameter"><code>action</code></em> is activated.</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-gtkaccessible.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-gtkactiongroup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Accessible </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.ActionGroup</td></tr></table></div></body></html>
|