File: class-gtkaction.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (125 lines) | stat: -rw-r--r-- 42,876 bytes parent folder | download
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.Action</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-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" lang="en"><a name="class-gtkaction"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.Action</h2><p>gtk.Action &#8212; an action which can be triggered by a menu or toolbar
item (new in PyGTK 2.4)</p></div><div class="refsect1" lang="en"><a name="id3042706"></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"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkaction.html#constructor-gtkaction" title="Constructor">gtk.Action</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>name</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>tooltip</tt></b></span></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-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 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 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 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 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 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 href="class-gtkaction.html#method-gtkaction--create-icon" title="gtk.Action.create_icon">create_icon</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>icon_size</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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 href="class-gtkaction.html#method-gtkaction--connect-proxy" title="gtk.Action.connect_proxy">connect_proxy</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>proxy</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkaction.html#method-gtkaction--disconnect-proxy" title="gtk.Action.disconnect_proxy">disconnect_proxy</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>proxy</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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 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 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"><b class="parameter"><tt>proxy</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>proxy</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>accel_path</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>accel_group</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkaction.html#method-gtkaction--set-sensitive" title="gtk.Action.set_sensitive">set_sensitive</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>sensitive</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkaction.html#method-gtkaction--set-visible" title="gtk.Action.set_visible">set_visible</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>visible</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3154902"></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-gtkaction.html" title="gtk.Action">gtk.Action</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id2956740"></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">"action-group"</td><td valign="top">Read-Write</td><td valign="top">The <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><tt class="classname">gtk.ActionGroup</tt></a>
this <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> is
associated with, or <tt class="literal">None</tt> (for internal use).</td></tr><tr valign="top"><td valign="top">"hide-if-empty"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, empty menu proxies for this
action are hidden.</td></tr><tr valign="top"><td valign="top">"is-important"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, <a href="class-gtktoolitem.html" title="gtk.ToolItem"><tt class="classname">gtk.ToolItem</tt></a>
proxies for this action show text in
<tt class="literal">gtk.TOOLBAR_BOTH_HORIZ</tt> 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 <tt class="literal">TRUE</tt>, 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 <tt class="literal">TRUE</tt>, 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 <tt class="literal">TRUE</tt>, the toolbar item is
visible when the toolbar is in a horizontal orientation.</td></tr><tr valign="top"><td valign="top">"visible-vertical"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, 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" lang="en"><a name="id3203254"></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-gtkaction.html#signal-gtkaction--activate" title='The "activate" gtk.Action Signal'>activate</a>"</span></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>action</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="id3199246"></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-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
represents operations that the user can perform, along with some information
how it should be presented in the interface. Each <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></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 type="disc"><li>a name (not translated, for path lookup)</li><li>a label (translated, for display)</li><li>an accelerator</li><li>whether the label indicates a stock id</li><li>a tooltip (optional, translated)</li><li>a toolbar label (optional, shorter than label)</li></ul></div><p>The action will also have some state information:</p><div class="itemizedlist"><ul type="disc"><li>visible (shown/hidden)</li><li>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 href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
subclasses.</p><p>Each <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></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" lang="en"><a name="constructor-gtkaction"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.Action</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>name</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>tooltip</tt></b></span></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>name</tt></b>:</span></td><td>a unique name for the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>label</tt></b>:</span></td><td>the label displayed in menu items and on
buttons</td></tr><tr><td><span class="term"><b class="parameter"><tt>tooltip</tt></b>:</span></td><td>a tooltip for the action</td></tr><tr><td><span class="term"><b class="parameter"><tt>stock_id</tt></b>:</span></td><td>the stock icon to display in widgets
representing the action</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</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-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
object. To add the action to a <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><tt class="classname">gtk.ActionGroup</tt></a>
and set the accelerator for the action, call the <a href="class-gtkactiongroup.html#method-gtkactiongroup--add-action-with-accel" title="gtk.ActionGroup.add_action_with_accel"><tt class="methodname">gtk.ActionGroup.add_action_with_accel()</tt></a>.</p></div><div class="refsect1" lang="en"><a name="id2937905"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkaction--get-name"></a><h3>gtk.Action.get_name</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_name</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 action.</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_name</tt>() method returns the value
of the "name" property containing the name of the action.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--is-sensitive"></a><h3>gtk.Action.is_sensitive</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">is_sensitive</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 the action and its
associated action group are both sensitive.</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">is_sensitive</tt>() method returns
<tt class="literal">TRUE</tt> if the action is effectively sensitive i.e. both the
<a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> and
its associated <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><tt class="classname">gtk.ActionGroup</tt></a>
are sensitive.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--get-sensitive"></a><h3>gtk.Action.get_sensitive</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_sensitive</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 the action itself
is sensitive.</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_sensitive</tt>() method returns the
value of the "sensitive" property. If "sensitive" is <tt class="literal">TRUE</tt>
the action itself is sensitive. Note that this doesn't necessarily mean
effective sensitivity. See the <a href="class-gtkaction.html#method-gtkaction--is-sensitive" title="gtk.Action.is_sensitive"><tt class="methodname">is_sensitive()</tt></a>
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--is-visible"></a><h3>gtk.Action.is_visible</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">is_visible</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 the action and
its associated action group are both visible.</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">is_visible</tt>() method returns
<tt class="literal">TRUE</tt> if the action is effectively visible i.e. both the
<a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> and
its associated <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><tt class="classname">gtk.ActionGroup</tt></a>
as visible.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--get-visible"></a><h3>gtk.Action.get_visible</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_visible</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 the action itself
is visible.</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_visible</tt>() method returns the
value of the "visible" property. If "visible" is <tt class="literal">TRUE</tt> the
<a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
itself is visible. Note that this doesn't necessarily mean effective
visibility. See the <a href="class-gtkaction.html#method-gtkaction--is-visible" title="gtk.Action.is_visible"><tt class="methodname">is_visible()</tt></a>
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--activate"></a><h3>gtk.Action.activate</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">activate</span>(<span class="methodparam"></span>)</code></pre></td></tr></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">activate</tt>() method emits the
"activate" signal on the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></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" lang="en"><a name="method-gtkaction--create-icon"></a><h3>gtk.Action.create_icon</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">create_icon</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>icon_size</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_size</tt></b>:</span></td><td>the size of the icon that should be
created.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a widget that displays the icon for this
action.</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">create_icon</tt>() method creates and
returns a <a href="class-gtkimage.html" title="gtk.Image"><tt class="classname">gtk.Image</tt></a> with the
size specified by <i class="parameter"><tt>size</tt></i> from the icon contained in the
"stock-id" property if it exists. The value of <i class="parameter"><tt>size</tt></i>
must be one of:</p><div class="itemizedlist"><ul type="disc"><li><tt class="literal">gtk.ICON_SIZE_MENU</tt></li><li><tt class="literal">gtk.ICON_SIZE_SMALL_TOOLBAR</tt></li><li><tt class="literal">gtk.ICON_SIZE_LARGE_TOOLBAR</tt></li><li><tt class="literal">gtk.ICON_SIZE_BUTTON</tt></li><li><tt class="literal">gtk.ICON_SIZE_DND</tt></li><li><tt class="literal">gtk.ICON_SIZE_DIALOG</tt></li></ul></div><p>This method is intended for use by <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
implementations to create icons displayed in the proxy widgets.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--create-menu-item"></a><h3>gtk.Action.create_menu_item</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">create_menu_item</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>a menu item connected to the
action.</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">create_menu_item</tt>() method creates
and returns a menu item widget that proxies for the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--create-tool-item"></a><h3>gtk.Action.create_tool_item</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">create_tool_item</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>a tool item connected to the
action.</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">create_tool_item</tt>() method creates
and returns a tool item widget that proxies for the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--connect-proxy"></a><h3>gtk.Action.connect_proxy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">connect_proxy</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>proxy</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>proxy</tt></b>:</span></td><td>the proxy widget</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">connect_proxy</tt>() method connects the
widget specified by <i class="parameter"><tt>proxy</tt></i> to the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> object as
a proxy. This method synchronizes various properties of the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> with the
widget (such as label text, icon, tooltip, etc), and attaches a callback so
that the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> is
activated when <i class="parameter"><tt>proxy</tt></i> is.</p><p>If <i class="parameter"><tt>proxy</tt></i> is already connected to another
<a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>, it
is disconnected first. The <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> should be
added to a <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><tt class="classname">gtk.ActionGroup</tt></a>
before calling this method.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--disconnect-proxy"></a><h3>gtk.Action.disconnect_proxy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">disconnect_proxy</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>proxy</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>proxy</tt></b>:</span></td><td>the proxy widget</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">disconnect_proxy</tt>() method
disconnects the widget specified by <i class="parameter"><tt>proxy</tt></i> from the
<a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>. This
method does <span class="emphasis"><em>not</em></span> destroy the widget. The <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> should be
added to a <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><tt class="classname">gtk.ActionGroup</tt></a>
before calling this method.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--get-proxies"></a><h3>gtk.Action.get_proxies</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_proxies</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>a list of proxy widgets.</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_proxies</tt>() method returns a list
containing the proxy widgets associated with the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--connect-accelerator"></a><h3>gtk.Action.connect_accelerator</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">connect_accelerator</span>(<span class="methodparam"></span>)</code></pre></td></tr></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">connect_accelerator</tt>() method
installs the accelerator for the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> if it has
an associated accel path and <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><tt class="classname">gtk.AccelGroup</tt></a>. See
the <a href="class-gtkaction.html#method-gtkaction--set-accel-path" title="gtk.Action.set_accel_path"><tt class="methodname">set_accel_path()</tt></a>
and the <a href="class-gtkaction.html#method-gtkaction--set-accel-group" title="gtk.Action.set_accel_group"><tt class="methodname">set_accel_group()</tt></a>
methods.</p><p>Since multiple proxies may independently trigger the
installation of the accelerator, the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> counts
the number of times this method has been called and doesn't remove the
accelerator until <a href="class-gtkaction.html#method-gtkaction--disconnect-accelerator" title="gtk.Action.disconnect_accelerator"><tt class="methodname">disconnect_accelerator()</tt></a>
has been called as many times.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--disconnect-accelerator"></a><h3>gtk.Action.disconnect_accelerator</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">disconnect_accelerator</span>(<span class="methodparam"></span>)</code></pre></td></tr></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">disconnect_accelerator</tt>() method
undoes the effect of one call to the <a href="class-gtkaction.html#method-gtkaction--connect-accelerator" title="gtk.Action.connect_accelerator"><tt class="methodname">connect_accelerator()</tt></a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--block-activate-from"></a><h3>gtk.Action.block_activate_from</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">block_activate_from</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>proxy</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>proxy</tt></b>:</span></td><td>a proxy widget</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">block_activate_from</tt>() method
disables calls to the <a href="class-gtkaction.html#method-gtkaction--activate" title="gtk.Action.activate"><tt class="methodname">activate()</tt></a>
method by signals on the widget specified by
<i class="parameter"><tt>proxy</tt></i>. This is used to break notification loops for
things like check or radio actions.</p><p>This method is intended for use by <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
implementations.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--unblock-activate-from"></a><h3>gtk.Action.unblock_activate_from</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">unblock_activate_from</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>proxy</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>proxy</tt></b>:</span></td><td>a proxy widget</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">unblock_activate_from</tt>() method
re-enables calls to the <a href="class-gtkaction.html#method-gtkaction--activate" title="gtk.Action.activate"><tt class="methodname">activate()</tt></a>
method by signals on the widget specified by <i class="parameter"><tt>proxy</tt></i>.
This undoes the blocking done by the <a href="class-gtkaction.html#method-gtkaction--block-activate-from" title="gtk.Action.block_activate_from"><tt class="methodname">block_activate_from()</tt></a>
method.</p><p>This method is intended for use by <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>
implementations.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--set-accel-path"></a><h3>gtk.Action.set_accel_path</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_accel_path</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_path</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>accel_path</tt></b>:</span></td><td>the accelerator path</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">sel_accel_path</tt>() method sets the
accel path for the action to the value of
<i class="parameter"><tt>accel_path</tt></i>. All proxy widgets associated with the
action will have this accel path, so that their accelerators are
consistent.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--set-accel-group"></a><h3>gtk.Action.set_accel_group</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_accel_group</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_group</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>accel_group</tt></b>:</span></td><td>a <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><tt class="classname">gtk.AccelGroup</tt></a> 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_accel_group</tt>() method sets the
<a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><tt class="classname">gtk.AccelGroup</tt></a>
specified by <i class="parameter"><tt>accel_group</tt></i> as the accelerator group for
the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--set-sensitive"></a><h3>gtk.Action.set_sensitive</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_sensitive</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>sensitive</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>sensitive</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> make the action
sensitive</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.6 and above.</p></div><p>The <tt class="methodname">set_sensitive</tt>() method sets the
"sensitive" property to the value of <i class="parameter"><tt>sensitive</tt></i>. Note
that this doesn't necessarily set the effective sensitivity. See the <a href="class-gtkaction.html#method-gtkaction--is-sensitive" title="gtk.Action.is_sensitive"><tt class="methodname">is_sensitive</tt>()</a>
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtkaction--set-visible"></a><h3>gtk.Action.set_visible</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_visible</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>visible</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>visible</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> make the action
visible</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.6 and above.</p></div><p>The <tt class="methodname">set_visible</tt>() method sets the
"visible" property to the value of <i class="parameter"><tt>visible</tt></i>. Note that
this doesn't necessarily set the effective visibility. See the <a href="class-gtkaction.html#method-gtkaction--is-visible" title="gtk.Action.is_visible"><tt class="methodname">is_visible</tt>()</a>
method for more information.</p></div></div><div class="refsect1" lang="en"><a name="id2976820"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkaction--activate"></a><h3>The "activate" gtk.Action 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>action</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>action</tt></i>:</span></td><td>the <a href="class-gtkaction.html" title="gtk.Action"><tt class="classname">gtk.Action</tt></a> 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><div class="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
<i class="parameter"><tt>action</tt></i> 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>