/usr/share/gtk-doc/html/pygtk/class-gtkaccelgroup.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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.AccelGroup</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-gtkaboutdialog.html" title="gtk.AboutDialog"><link rel="next" href="class-gtkaccellabel.html" title="gtk.AccelLabel"></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.AccelGroup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkaboutdialog.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkaccellabel.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.AccelGroup"><a name="class-gtkaccelgroup"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.AccelGroup</h2><p>gtk.AccelGroup — a group of accelerators for a Window hierarchy</p></div><div class="refsect1" title="Synopsis"><a name="id3550921"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.AccelGroup</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-gtkaccelgroup.html#constructor-gtkaccelgroup" title="Constructor">gtk.AccelGroup</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--lock" title="gtk.AccelGroup.lock">lock</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--unlock" title="gtk.AccelGroup.unlock">unlock</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--connect-group" title="gtk.AccelGroup.connect_group">connect</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_mods</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_flags</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--connect-group" title="gtk.AccelGroup.connect_group">connect_group</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_mods</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_flags</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--connect-by-path" title="gtk.AccelGroup.connect_by_path">connect_by_path</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--disconnect-key" title="gtk.AccelGroup.disconnect_key">disconnect_key</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_mods</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--get-is-locked" title="gtk.AccelGroup.get_is_locked">get_is_locked</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--get-modifier-mask" title="gtk.AccelGroup.get_modifier_mask">get_modifier_mask</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-valid" title="gtk.accelerator_valid">gtk.accelerator_valid</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>modifiers</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-parse" title="gtk.accelerator_parse">gtk.accelerator_parse</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-name" title="gtk.accelerator_name">gtk.accelerator_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator_mods</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-set-default-mod-mask" title="gtk.accelerator_set_default_mod_mask">gtk.accelerator_set_default_mod_mask</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>default_mod_mask</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-get-default-mod-mask" title="gtk.accelerator_get_default_mod_mask">gtk.accelerator_get_default_mod_mask</a></span>()</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-get-label" title="gtk.accelerator_get_label">gtk.accelerator_get_label</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator_mods</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccelgroup.html#function-gtk--accel-groups-from-object" title="gtk.accel_groups_from_object">gtk.accel_groups_from_object</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>object</code></em></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3561591"></a><h2>Ancestry</h2><pre class="synopsis">
+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup">gtk.AccelGroup</a>
</pre></div><div class="refsect1" title="gtk.AccelGroup Properties"><a name="properties-gtkaccelgroup"></a><h2>gtk.AccelGroup 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">"is-locked"</td><td valign="top">Read</td><td valign="top">
<code class="literal">True</code> if the accel group is locked, <code class="literal">False</code> otherwise.
</td></tr><tr valign="top"><td valign="top">"modifier-mask"</td><td valign="top">Read</td><td valign="top">
The modifier mask of the accel group.
</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.AccelGroup Signal Prototypes"><a name="signal-prototypes-gtkaccelgroup"></a><h2>gtk.AccelGroup Signal Prototypes</h2><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-gtkaccelgroup.html#signal-gtkaccelgroup--accel-activate" title='The "accel-activate" gtk.AccelGroup Signal'>accel-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>accelgroup</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>acceleratable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_key</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_mods</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkaccelgroup.html#signal-gtkaccelgroup--accel-changed" title='The "accel-changed" gtk.AccelGroup Signal'>accel-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>accelgroup</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_key</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_mods</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>closure</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="id3561314"></a><h2>Description</h2><p>A <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
object groups all the accelerators for the associated window hierarchy
(either <a class="link" href="class-gtkwindow.html" title="gtk.Window"><code class="classname">gtk.Window</code></a> (or a
descendant) or <a class="link" href="class-gtkmenushell.html" title="gtk.MenuShell"><code class="classname">gtk.MenuShell</code></a> (or
a descendant)). Once the <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
is associated with a window or menu (using <a class="link" href="class-gtkwindow.html#method-gtkwindow--add-accel-group" title="gtk.Window.add_accel_group"><code class="methodname">gtk.Window.add_accel_group</code>()</a>
or <a class="link" href="class-gtkmenu.html#method-gtkmenu--set-accel-group" title="gtk.Menu.set_accel_group"><code class="methodname">gtk.Menu.set_accel_group</code>()</a>),
accelerators can be added to the widget or one of its children by using
<a class="link" href="class-gtkwidget.html#method-gtkwidget--add-accelerator" title="gtk.Widget.add_accelerator"><code class="methodname">gtk.Widget.add_accelerator</code>()</a>
. Accelerators can also be added by using a <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.ItemFactory</code></a>.</p><p>Note that accelerators are different from mnemonics. Accelerators
are shortcuts for activating a menu item; they appear alongside the menu
item they're a shortcut for. For example
<span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Q</strong></span> might appear alongside the
<span class="guimenu">Files</span> → <span class="guimenuitem">Quit</span> menu item. Mnemonics are shortcuts for GUI elements such
as text entries or buttons; they appear as underlined characters. Of course,
menu items can have both accelerators and mnemonics.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkaccelgroup"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.AccelGroup</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>an AccelGroup object</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
object.</p></div><div class="refsect1" title="Methods"><a name="id3561154"></a><h2>Methods</h2><div class="refsect2" title="gtk.AccelGroup.lock"><a name="method-gtkaccelgroup--lock"></a><h3>gtk.AccelGroup.lock</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">lock</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">lock</code>() method locks the accelerator
group. preventing its accelerators from being changed during runtime. Refer
to <a class="link" href="class-gtkaccelmap.html#function-gtk--accel-map-change-entry" title="gtk.accel_map_change_entry"><code class="function">gtk.accel_map_change_entry</code>()</a>
about runtime accelerator changes.</p><p>If called more than once, the accelerator group remains locked
until <a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--unlock" title="gtk.AccelGroup.unlock"><code class="methodname">gtk.AccelGroup.unlock</code>()</a>
has been called an equivalent number of times.</p></div><div class="refsect2" title="gtk.AccelGroup.unlock"><a name="method-gtkaccelgroup--unlock"></a><h3>gtk.AccelGroup.unlock</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unlock</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">unlock</code>() method undoes the last
call to <a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--lock" title="gtk.AccelGroup.lock"><code class="methodname">gtk.AccelGroup.lock</code>()</a>
for this accelerator group.</p></div><div class="refsect2" title="gtk.AccelGroup.connect_group"><a name="method-gtkaccelgroup--connect-group"></a><h3>gtk.AccelGroup.connect_group</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">connect_group</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_mods</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_flags</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</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_key</code></strong> :</span></p></td><td>key value of the
accelerator</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_mods</code></strong> :</span></p></td><td>modifier combination of the
accelerator</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_flags</code></strong> :</span></p></td><td>a flag mask to configure this
accelerator</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>callback</code></strong> :</span></p></td><td>a function or method to be executed upon
accelerator activation</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.2 as
<em class="parameter"><code>connect</code></em>() and was changed in PyGTK 2.4 and
above to <em class="parameter"><code>connect_group</code></em>() to avoid conflict
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">gobject.GObject.connect</code>()</PYGTKDOCLINK>
method.</p></div><p>The <code class="methodname">connect_group</code>() method installs an
accelerator in the accelerator group. When the accelerator group is being
activated, the function (or method) specified by
<em class="parameter"><code>callback</code></em> will be invoked if the accelerator key and
modifier key match those specified by <em class="parameter"><code>accel_key</code></em> and
<em class="parameter"><code>accel_mods</code></em>.</p><p>The value of <em class="parameter"><code>modifier</code></em> is a combination of
the <a class="xref" href="gdk-constants.html#gdk-modifier-constants" title="GDK Modifier Constants">GDK Modifier Constants</a>. <em class="parameter"><code>accel_flags</code></em>
is a combination of <code class="literal">gtk.ACCEL_VISIBLE</code> and
<code class="literal">gtk.ACCEL_LOCKED</code>.</p><p>The <em class="parameter"><code>callback</code></em> function is defined as:</p><pre class="programlisting">
def callback(accel_group, acceleratable, keyval, modifier)
</pre><p>where <em class="parameter"><code>accel_group</code></em> is the accelerator
group, <em class="parameter"><code>acceleratable</code></em> is the object that the
<em class="parameter"><code>accel_group</code></em> is attached to (e.g. a <a class="link" href="class-gtkwindow.html" title="gtk.Window"><code class="classname">gtk.Window</code></a>),
<em class="parameter"><code>keyval</code></em> is the accelerator key and
<em class="parameter"><code>modifier</code></em> is the key
modifier. <em class="parameter"><code>callback</code></em> returns <code class="literal">True</code> if
the accelerator was handled by <em class="parameter"><code>callback</code></em>.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Due to implementation details, a single function or method
can only be connected to one accelerator group.</p></div></div><div class="refsect2" title="gtk.AccelGroup.connect_by_path"><a name="method-gtkaccelgroup--connect-by-path"></a><h3>gtk.AccelGroup.connect_by_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">connect_by_path</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</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>path used for determining key and
modifiers.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>callback</code></strong> :</span></p></td><td>function or method to be executed upon accelerator
activation</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_by_path</code>() method installs
an accelerator in the accelerator group, using an accelerator path to look
up the appropriate key and modifiers (see the function <a class="link" href="class-gtkaccelmap.html#function-gtk--accel-map-add-entry" title="gtk.accel_map_add_entry"><code class="function">gtk.accel_map_add_entry</code>()</a>). When
the accelerator group is being activated, the function (or method) specified
by <em class="parameter"><code>callback</code></em> will be invoked if the
<em class="parameter"><code>accel_key</code></em> and <em class="parameter"><code>accel_mods</code></em> that
cause the activation match the key and modifiers for the accelerator path
specified by <em class="parameter"><code>accel_path</code></em>.</p><p>The <em class="parameter"><code>callback</code></em> function is defined as:</p><pre class="programlisting">
def callback(accel_group, acceleratable, keyval, modifier)
</pre><p>where <em class="parameter"><code>accel_group</code></em> is the accelerator
group, <em class="parameter"><code>acceleratable</code></em> is the object that the
<em class="parameter"><code>accel_group</code></em> is attached to (e.g. a <a class="link" href="class-gtkwindow.html" title="gtk.Window"><code class="classname">gtk.Window</code></a>),
<em class="parameter"><code>keyval</code></em> is the accelerator key and
<em class="parameter"><code>modifier</code></em> is the key
modifier. <em class="parameter"><code>callback</code></em> returns <code class="literal">True</code> if
the accelerator was handled by <em class="parameter"><code>callback</code></em>.</p></div><div class="refsect2" title="gtk.AccelGroup.disconnect_key"><a name="method-gtkaccelgroup--disconnect-key"></a><h3>gtk.AccelGroup.disconnect_key</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">disconnect_key</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_mods</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_key</code></strong> :</span></p></td><td>key value of the
accelerator</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_mods</code></strong> :</span></p></td><td>modifier combination of the
accelerator</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if there was an
accelerator which was removed, <code class="literal">False</code>
otherwise</td></tr></tbody></table><p>The <code class="methodname">disconnect</code>() method removes a
previously installed accelerator specified by
<em class="parameter"><code>accel_key</code></em> and <em class="parameter"><code>accel_mods</code></em> from
the accelerator group.</p></div><div class="refsect2" title="gtk.AccelGroup.get_is_locked"><a name="method-gtkaccelgroup--get-is-locked"></a><h3>gtk.AccelGroup.get_is_locked</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_is_locked</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 there are 1 or more locks
on the accel_group, <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.14 and above.</p></div><p>
The <code class="methodname">get_is_locked</code>() method returns the locked status.
Locks are added and removed using
<a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--lock" title="gtk.AccelGroup.lock">lock</a>() and
<a class="link" href="class-gtkaccelgroup.html#method-gtkaccelgroup--lock" title="gtk.AccelGroup.lock">lock</a>().
</p></div><div class="refsect2" title="gtk.AccelGroup.get_modifier_mask"><a name="method-gtkaccelgroup--get-modifier-mask"></a><h3>gtk.AccelGroup.get_modifier_mask</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_modifier_mask</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 modifier mask for this accel group.</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.14 and above.</p></div><p>
The <code class="methodname">get_modifier_mask</code>() method gets a
GdkModifierType representing the mask for this accel_group.
For example, gtk.gdk.CONTROL_MASK, gtk.gdk.SHIFT_MASK, etc.
</p></div></div><div class="refsect1" title="Functions"><a name="id3497811"></a><h2>Functions</h2><div class="refsect2" title="gtk.accelerator_valid"><a name="function-gtk--accelerator-valid"></a><h3>gtk.accelerator_valid</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accelerator_valid</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>modifiers</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>keyval</code></strong> :</span></p></td><td>a key value</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>modifiers</code></strong> :</span></p></td><td>a modifier mask</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the accelerator is
valid</td></tr></tbody></table><p>The <code class="function">gtk.accelerator_valid</code>() function
returns <code class="literal">True</code> if the specified
<em class="parameter"><code>keyval</code></em> and <em class="parameter"><code>modifiers</code></em>
constitute a valid keyboard accelerator. For example, the
<code class="literal">ord('a')</code> keyval plus
<code class="literal">gtk.gdk.CONTROL_MASK</code> is valid - this is a <span class="keycap"><strong>Control</strong></span>+<span class="keycap"><strong>a</strong></span>
accelerator. The value of <em class="parameter"><code>modifiers</code></em> is a combination
of the <a class="xref" href="gdk-constants.html#gdk-modifier-constants" title="GDK Modifier Constants">GDK Modifier Constants</a>.</p></div><div class="refsect2" title="gtk.accelerator_parse"><a name="function-gtk--accelerator-parse"></a><h3>gtk.accelerator_parse</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accelerator_parse</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator</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>accelerator</code></strong> :</span></p></td><td>a string representing an
accelerator</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing the keyval and modifier
mask of the accelerator</td></tr></tbody></table><p>The <code class="function">gtk.accelerator_parse</code>() function parses
the specified <em class="parameter"><code>accelerator</code></em> string and returns a
2-tuple containing the keyval and modifier mask corresponding to
<em class="parameter"><code>accelerator</code></em>. The format looks like "<Control>a" or
"<Shift><Alt>F1" or "<Release>z" (the last one is for key release). The
parser is fairly liberal and allows lower or upper case, and also
abbreviations such as "<Ctl>" and "<Ctrl>". If the parse fails, the tuple
values will both be 0 (zero). See the <a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-valid" title="gtk.accelerator_valid"><code class="function">gtk.accelerator_valid</code>()</a>
function for more details.</p></div><div class="refsect2" title="gtk.accelerator_name"><a name="function-gtk--accelerator-name"></a><h3>gtk.accelerator_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accelerator_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></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>accelerator_key</code></strong> :</span></p></td><td>a key value</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accelerator_mods</code></strong> :</span></p></td><td>a modifier mask</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string representing the accelerator or
<code class="literal">None</code> if not a valid accelerator</td></tr></tbody></table><p>The <code class="function">gtk.accelerator_name</code>() function
converts the accelerator keyval and modifier mask (specified by
<em class="parameter"><code>accelerator_key</code></em> and
<em class="parameter"><code>accelerator_mods</code></em>) into a string parseable by the
<a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-parse" title="gtk.accelerator_parse"><code class="function">gtk.accelerator_parse</code>()</a>
function. For example, if you pass in <code class="literal">ord('q')</code> and
<code class="literal">gtk.gdk.CONTROL_MASK</code>, this function returns
"<Control>q".</p></div><div class="refsect2" title="gtk.accelerator_set_default_mod_mask"><a name="function-gtk--accelerator-set-default-mod-mask"></a><h3>gtk.accelerator_set_default_mod_mask</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accelerator_set_default_mod_mask</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>default_mod_mask</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>default_mod_mask</code></strong> :</span></p></td><td>the new default accelerator modifier
mask</td></tr></tbody></table><p>The <code class="function">gtk.accelerator_set_default_mod_mask</code>()
function sets the modifiers (specified by
<em class="parameter"><code>default_mod_mask</code></em>) that will be considered significant
for keyboard accelerators. The default mod mask is
<code class="literal">gtk.gdk.CONTROL_MASK</code> |
<code class="literal">gtk.gdk.SHIFT_MASK</code> |
<code class="literal">gtk.gdk.MOD1_MASK</code>, that is, <span class="keycap"><strong>Control</strong></span>,
<span class="keycap"><strong>Shift</strong></span>, and <span class="keycap"><strong>Alt</strong></span>. Other modifiers will by
default be ignored by <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>.
You must include at least the three default modifiers in any value you pass
to this function. The default mod mask should be changed on application
startup, before using any accelerator groups. The value of
<em class="parameter"><code>default_mod_mask</code></em> is a combination of the <a class="xref" href="gdk-constants.html#gdk-modifier-constants" title="GDK Modifier Constants">GDK Modifier Constants</a>.</p></div><div class="refsect2" title="gtk.accelerator_get_default_mod_mask"><a name="function-gtk--accelerator-get-default-mod-mask"></a><h3>gtk.accelerator_get_default_mod_mask</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accelerator_get_default_mod_mask</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 default accelerator modifier
mask</td></tr></tbody></table><p>The <code class="function">gtk.accelerator_get_default_mod_mask</code>()
function returns the default accelerator modifier mask as set by the <a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-set-default-mod-mask" title="gtk.accelerator_set_default_mod_mask"><code class="function">gtk.accelerator_set_default_mod_mask</code>()</a>
function. See the <a class="link" href="class-gtkaccelgroup.html#function-gtk--accelerator-set-default-mod-mask" title="gtk.accelerator_set_default_mod_mask"><code class="function">gtk.accelerator_set_default_mod_mask</code>()</a>
function for more detail on modifier masks.</p></div><div class="refsect2" title="gtk.accelerator_get_label"><a name="function-gtk--accelerator-get-label"></a><h3>gtk.accelerator_get_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accelerator_get_label</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator_key</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accelerator_mods</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>accelerator_key</code></strong> :</span></p></td><td>a key value</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accelerator_mods</code></strong> :</span></p></td><td>a modifier mask</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string representing the
accelerator</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 function is available in PyGTK 2.6 and above.</p></div><p>The <code class="function">gtk.accelerator_get_label</code>() function
converts the accelerator keyval and modifier mask specified by
<em class="parameter"><code>accelerator_key</code></em> and
<em class="parameter"><code>accelerator_mods</code></em> respectively into a string which can
be used to represent the accelerator to the user. The value of
<em class="parameter"><code>accelerator_mods</code></em> is a combination of the <a class="xref" href="gdk-constants.html#gdk-modifier-constants" title="GDK Modifier Constants">GDK Modifier Constants</a>.</p></div><div class="refsect2" title="gtk.accel_groups_from_object"><a name="function-gtk--accel-groups-from-object"></a><h3>gtk.accel_groups_from_object</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.accel_groups_from_object</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>object</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>object</code></em> :</span></p></td><td>a GObject usually a <a class="link" href="class-gtkwindow.html" title="gtk.Window"><code class="classname">gtk.Window</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 function is available in PyGTK 2.4 and above.</p></div><p>The <code class="function">gtk.accel_groups_from_object</code>() function
returns a list of all the <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
objects attached to the object specified by
<em class="parameter"><code>object</code></em>.</p></div></div><div class="refsect1" title="Signals"><a name="id3000794"></a><h2>Signals</h2><div class="refsect2" title='The "accel-activate" gtk.AccelGroup Signal'><a name="signal-gtkaccelgroup--accel-activate"></a><h3>The "accel-activate" gtk.AccelGroup Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>accelgroup</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>acceleratable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_key</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_mods</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>accelgroup</code></em> :</span></p></td><td>the accelgroup that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>acceleratable</code></em> :</span></p></td><td>the object that the accelerator is associated
with</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_key</code></em> :</span></p></td><td>the accelerator key value</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_mods</code></em> :</span></p></td><td>the accelerator modifiers</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">gobject.GObject.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><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the accelerator
was handled</td></tr></tbody></table><p>The "accel-activate" signal is emitted when an accelerator is
activated.</p></div><div class="refsect2" title='The "accel-changed" gtk.AccelGroup Signal'><a name="signal-gtkaccelgroup--accel-changed"></a><h3>The "accel-changed" gtk.AccelGroup Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>accelgroup</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_key</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>accel_mods</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>closure</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>accelgroup</code></em> :</span></p></td><td>the accelgroup that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_key</code></em> :</span></p></td><td>the key value of the
accelerator</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_mods</code></em> :</span></p></td><td>the modifiers of the
accelerator</td></tr><tr><td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td><td>the closure of the
accelerator</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "accel-changed" signal is emitted when an accelerator is
added or removed from an accelerator group.</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-gtkaboutdialog.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-gtkaccellabel.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.AboutDialog </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.AccelLabel</td></tr></table></div></body></html>
|