/usr/share/gtk-doc/html/pygtk/class-gtkaccellabel.html is in python-gtk2-doc 2.24.0-3.
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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.AccelLabel</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-gtkaccelgroup.html" title="gtk.AccelGroup"><link rel="next" href="class-gtkaccelmap.html" title="gtk.AccelMap"></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.AccelLabel</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkaccelgroup.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkaccelmap.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.AccelLabel"><a name="class-gtkaccellabel"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.AccelLabel</h2><p>gtk.AccelLabel — a label which displays accelerator info to the right of the text</p></div><div class="refsect1" title="Synopsis"><a name="id3205753"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.AccelLabel</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtklabel.html" title="gtk.Label">gtk.Label</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkaccellabel.html#constructor-gtkaccellabel" title="Constructor">gtk.AccelLabel</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>string</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--accelerator-width" title="gtk.AccelLabel.accelerator_width">accelerator_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--get-accel-widget" title="gtk.AccelLabel.get_accel_widget">get_accel_widget</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--get-accel-width" title="gtk.AccelLabel.get_accel_width">get_accel_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--set-accel-widget" title="gtk.AccelLabel.set_accel_widget">set_accel_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_widget</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--refetch" title="gtk.AccelLabel.refetch">refetch</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3003079"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a class="link" href="class-gtkmisc.html" title="gtk.Misc">gtk.Misc</a>
+-- <a class="link" href="class-gtklabel.html" title="gtk.Label">gtk.Label</a>
+-- <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel">gtk.AccelLabel</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id2890130"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</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.AccelLabel Properties"><a name="properties-gtkaccellabel"></a><h2>gtk.AccelLabel Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><p><a class="link" href="class-gtkwidget.html#properties-gtkwidget" title="gtk.Widget Properties">gtk.Widget Properties</a></p><p><a class="link" href="class-gtkmisc.html#properties-gtkmisc" title="gtk.Misc Properties">gtk.Misc Properties</a></p><p><a class="link" href="class-gtklabel.html#properties-gtklabel" title="gtk.Label Properties">gtk.Label Properties</a></p><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"accel-closure"</td><td valign="top">Read-Write</td><td valign="top">The closure to be monitored for accelerator
changes</td></tr><tr valign="top"><td valign="top">"accel-widget"</td><td valign="top">Read-Write</td><td valign="top">The widget associated with the accelerator
label</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.AccelLabel Style Properties"><a name="style-properties-gtkaccellabel"></a><h2>gtk.AccelLabel Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p></div><div class="refsect1" title="gtk.AccelLabel Signal Prototypes"><a name="signal-prototypes-gtkaccellabel"></a><h2>gtk.AccelLabel Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p><p><a class="link" href="class-gtklabel.html#signal-prototypes-gtklabel" title="gtk.Label Signal Prototypes">gtk.Label Signal Prototypes</a></p></div><div class="refsect1" title="Description"><a name="id2993483"></a><h2>Description</h2><p>The <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
widget is a subclass of <a class="link" href="class-gtklabel.html" title="gtk.Label"><code class="classname">gtk.Label</code></a> that
displays an accelerator string to the right of the label text, e.g.
<span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>S</strong></span>. It is commonly used in menus to show the keyboard
shortcuts for commands. The accelerator string to display is not set
explicitly; instead, the <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
displays the accelerators which have been added to the associated widget. A
widget is associated with the accelerator label by calling <a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--set-accel-widget" title="gtk.AccelLabel.set_accel_widget"><code class="methodname">set_accel_widget</code>()</a>.</p><p>For example, a <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widget may have an accelerator added to emit the "activate" signal when the
<span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>S</strong></span> key combination is pressed. A <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
is created and added to the <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>, and
<a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--set-accel-widget" title="gtk.AccelLabel.set_accel_widget"><code class="methodname">set_accel_widget</code>()</a> is called with the <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> as
the first argument. The <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
will now display <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>S</strong></span> after its label.</p><p>Creating a <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> with
the <a class="link" href="class-gtkmenuitem.html#constructor-gtkmenuitem" title="Constructor"><code class="function">gtk.MenuItem</code>()</a>
function (or one of the similar functions <a class="link" href="class-gtkcheckmenuitem.html#constructor-gtkcheckmenuitem" title="Constructor"><code class="function">gtk.CheckMenuItem</code>()</a>
and <a class="link" href="class-gtkradiomenuitem.html#constructor-gtkradiomenuitem" title="Constructor"><code class="function">gtk.RadioMenuItem</code>()</a>)
and specifying a label, automatically adds a <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
to the <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> and
calls <a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--set-accel-widget" title="gtk.AccelLabel.set_accel_widget"><code class="methodname">set_accel_widget</code>()</a>
to set it up for you.</p><p>A <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
will only display accelerators which have
<code class="literal">gtk.ACCEL_VISIBLE</code> set. A <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
can display multiple accelerators and even signal names, though it is almost
always used to display just one accelerator.</p><p>The following code fragment creates a simple menu item with an
accelerator and enables the display of the accelerator key string in the
menu item label:</p><div class="example"><a name="id3253816"></a><p class="title"><b>Example 1. Creating a simple menu item with an accelerator key.</b></p><div class="example-contents"><pre class="programlisting">
# Create an accelgroup and add it to the window
accel_group = gtk.AccelGroup()
window.add_accel_group(accel_group)
# Create the menu item
save_item = gtk.MenuItem("Save")
save_item.show()
menu.add(save_item)
# Now add the accelerator to the menu item. Note that since we created
# the menu item with a label the AccelLabel is automatically setup to
# display the accelerators.
save_item.add_accelerator("activate", accel_group, ord("S"),
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
</pre></div></div><br class="example-break"></div><div class="refsect1" title="Constructor"><a name="constructor-gtkaccellabel"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.AccelLabel</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>string</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>string</code></strong> :</span></p></td><td>the label string</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <code class="classname">gtk.AccelLabel</code>
object</td></tr></tbody></table><p><code class="function">gtk.AccelLabel</code>() creates a new <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
object. The <em class="parameter"><code>string</code></em> parameter specifies the text to be
displayed by the label. The accelerator text is automatically added by the
associated widget.</p></div><div class="refsect1" title="Methods"><a name="id3008712"></a><h2>Methods</h2><div class="refsect2" title="gtk.AccelLabel.accelerator_width"><a name="method-gtkaccellabel--accelerator-width"></a><h3>gtk.AccelLabel.accelerator_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">accelerator_width</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 width in pixels needed</td></tr></tbody></table><p>The <code class="methodname">accelerator_width</code>() method returns
the width in pixels needed to display the accelerator(s). It is used by
menus to align all of the <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widgets, and isn't usually needed by applications.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p><code class="methodname">accelerator_width</code>() is deprecated
- use the <a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--get-accel-width" title="gtk.AccelLabel.get_accel_width"><code class="methodname">get_accel_width</code>()</a>
method instead.</p></div></div><div class="refsect2" title="gtk.AccelLabel.get_accel_widget"><a name="method-gtkaccellabel--get-accel-widget"></a><h3>gtk.AccelLabel.get_accel_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_accel_widget</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 widget associated with the accelerator
label, or <code class="literal">None</code>.</td></tr></tbody></table><p>The <code class="methodname">get_accel_widget</code>() method retrieves
the widget associated with this accelerator label. See <a class="link" href="class-gtkaccellabel.html#method-gtkaccellabel--set-accel-widget" title="gtk.AccelLabel.set_accel_widget"><code class="function">gtk.AccelLabel.set_accel_widget()</code></a>.
</p></div><div class="refsect2" title="gtk.AccelLabel.get_accel_width"><a name="method-gtkaccellabel--get-accel-width"></a><h3>gtk.AccelLabel.get_accel_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_accel_width</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 width in pixels needed</td></tr></tbody></table><p>The <code class="methodname">get_accel_width</code>() method returns
the width in pixels needed to display the accelerator(s). It is used by
menus to align all of the <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widgets, and isn't usually needed by applications.</p></div><div class="refsect2" title="gtk.AccelLabel.set_accel_widget"><a name="method-gtkaccellabel--set-accel-widget"></a><h3>gtk.AccelLabel.set_accel_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_accel_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_widget</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_widget</code></strong> :</span></p></td><td>the widget to be
associated.</td></tr></tbody></table><p>The <code class="methodname">set_accel_widget</code>() method
associates the accelerator label with the widget specified by
<em class="parameter"><code>accel_widget</code></em>.</p></div><div class="refsect2" title="gtk.AccelLabel.refetch"><a name="method-gtkaccellabel--refetch"></a><h3>gtk.AccelLabel.refetch</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">refetch</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>False</td></tr></tbody></table><p>The <code class="methodname">refetch</code>() method recreates the
accelerator label string holding the accelerator information when the
accelerator is changed. The size of the string is also recalculated.</p><p>This method is not usually needed by applications since the
accelerator label string is automatically updated whenever accelerators are
added or removed from the associated widget.</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-gtkaccelgroup.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-gtkaccelmap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.AccelGroup </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.AccelMap</td></tr></table></div></body></html>
|