/usr/share/gtk-doc/html/pygtk/class-gtkmenuitem.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 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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.MenuItem</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-gtkmenubar.html" title="gtk.MenuBar"><link rel="next" href="class-gtkmenushell.html" title="gtk.MenuShell"></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.MenuItem</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkmenubar.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkmenushell.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.MenuItem"><a name="class-gtkmenuitem"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.MenuItem</h2><p>gtk.MenuItem — the widget used for an item in menus</p></div><div class="refsect1" title="Synopsis"><a name="id3790916"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.MenuItem</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkitem.html" title="gtk.Item">gtk.Item</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkmenuitem.html#constructor-gtkmenuitem" title="Constructor">gtk.MenuItem</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_underline</code></strong></span><span class="initializer">=True</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--set-submenu" title="gtk.MenuItem.set_submenu">set_submenu</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>submenu</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--get-submenu" title="gtk.MenuItem.get_submenu">get_submenu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--remove-submenu" title="gtk.MenuItem.remove_submenu">remove_submenu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--select" title="gtk.MenuItem.select">select</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--deselect" title="gtk.MenuItem.deselect">deselect</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--activate" title="gtk.MenuItem.activate">activate</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--toggle-size-request" title="gtk.MenuItem.toggle_size_request">toggle_size_request</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--toggle-size-allocate" title="gtk.MenuItem.toggle_size_allocate">toggle_size_allocate</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>allocation</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--set-right-justified" title="gtk.MenuItem.set_right_justified">set_right_justified</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>right_justified</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--get-right-justified" title="gtk.MenuItem.get_right_justified">get_right_justified</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--set-accel-path" title="gtk.MenuItem.set_accel_path">set_accel_path</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_path</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--get-accel-path" title="gtk.MenuItem.get_accel_path">get_accel_path</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--set-label" title="gtk.MenuItem.set_label">set_label</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--get-label" title="gtk.MenuItem.get_label">get_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--set-use-underline" title="gtk.MenuItem.set_use_underline">set_use_underline</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--get-use-underline" title="gtk.MenuItem.get_use_underline">get_use_underline</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3791362"></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-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a class="link" href="class-gtkitem.html" title="gtk.Item">gtk.Item</a>
+-- <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem">gtk.MenuItem</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id3791420"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
<a class="link" href="class-atkimplementor.html" title="atk.Implementor"><code class="classname">atk.ImplementorIFace</code></a>
</p></div><div class="refsect1" title="gtk.MenuItem Properties"><a name="properties-gtkmenuitem"></a><h2>gtk.MenuItem 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-gtkcontainer.html#properties-gtkcontainer" title="gtk.Container Properties">gtk.Container 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-path"</td><td valign="top">Read-Write</td><td valign="top">Sets the accelerator path of the menu item, through
which runtime changes of the menu item's accelerator caused
by the user can be identified and saved to persistant storage.
Default value: <code class="literal">None</code>.
Available in GTK+ 2.14.
</td></tr><tr valign="top"><td valign="top">"label"</td><td valign="top">Read-Write</td><td valign="top">The text for the child label.
Available in GTK+ 2.16.
</td></tr><tr valign="top"><td valign="top">"right-justified"</td><td valign="top">Read-Write</td><td valign="top">Sets whether the menu item appears justified at the
right side of a menu bar.
Default value: <code class="literal">False</code>.
Available in GTK+ 2.14.
</td></tr><tr valign="top"><td valign="top">"submenu"</td><td valign="top">Read-Write</td><td valign="top">The submenu attached to the menu item, or
<code class="literal">None</code> if it has none. This
property is available in GTK+ 2.12 and above.</td></tr><tr valign="top"><td valign="top">"use-underline"</td><td valign="top">Read-Write</td><td valign="top"><code class="literal">True</code> if underlines in the text
indicate mnemonics.
Available in GTK+ 2.16.
</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.MenuItem Style Properties"><a name="style-properties-gtkmenuitem"></a><h2>gtk.MenuItem 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 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">"arrow-scaling"</td><td valign="top">Read</td><td valign="top">Amount of space used up by arrow, relative to the menu item's font size.
Allowed values: [0,2].
Default value: 0.8</td></tr><tr valign="top"><td valign="top">"arrow-spacing"</td><td valign="top">Read</td><td valign="top">Space between label and arrow. Allowed values: >= 0.
Default value: 10</td></tr><tr valign="top"><td valign="top">"horizontal-padding"</td><td valign="top">Read</td><td valign="top">Padding to left and right of the menu item. Allowed
values: >= 0. Default value: 3</td></tr><tr valign="top"><td valign="top">"selected-shadow-type"</td><td valign="top">Read</td><td valign="top">The shadow type when the item is selected. Default
value: <code class="literal">gtk.SHADOW_NONE</code></td></tr><tr valign="top"><td valign="top">"toggle-spacing"</td><td valign="top">Read</td><td valign="top">Space between icon and label. Allowed values: >= 0.
Default value: 5</td></tr><tr valign="top"><td valign="top">"width-chars"</td><td valign="top">Read</td><td valign="top">The minimum desired width of the menu item in characters.
Allowed values: >= 0. Default value: 12.
Available in GTK+ 2.14.
</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.MenuItem Signal Prototypes"><a name="signal-prototypes-gtkmenuitem"></a><h2>gtk.MenuItem 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-gtkcontainer.html#signal-prototypes-gtkcontainer" title="gtk.Container Signal Prototypes">gtk.Container Signal Prototypes</a></p><p><a class="link" href="class-gtkitem.html#signal-prototypes-gtkitem" title="gtk.Item Signal Prototypes">gtk.Item Signal Prototypes</a></p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gtkmenuitem.html#signal-gtkmenuitem--activate" title='The "activate" gtk.MenuItem Signal'>activate</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</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-gtkmenuitem.html#signal-gtkmenuitem--activate-item" title='The "activate-item" gtk.MenuItem Signal'>activate-item</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</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-gtkmenuitem.html#signal-gtkmenuitem--toggle-size-allocate" title='The "toggle-size-allocate" gtk.MenuItem Signal'>toggle-size-allocate</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>allocation</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-gtkmenuitem.html#signal-gtkmenuitem--toggle-size-request" title='The "toggle-size-request" gtk.MenuItem Signal'>toggle-size-request</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>requisition</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="id3792190"></a><h2>Description</h2><p>The <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widget implements the appearance and behavior of menu items. The <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> and
its derived widget subclasses are the only valid children of menus.</p><p>When menu items are selected and activated by a user they
can:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">display a popup menu if they have an associated
submenu</li><li class="listitem">invoke an associated function or method</li></ul></div><p>As a <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> is a
subclass of <a class="link" href="class-gtkbin.html" title="gtk.Bin"><code class="classname">gtk.Bin</code></a> it can hold any
valid child widget.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkmenuitem"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.MenuItem</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_underline</code></strong></span><span class="initializer">=True</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>label</code></strong> :</span></p></td><td>a string to be used as the text of the menu item
or <code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>use_underline</code></strong> :</span></p></td><td>if <code class="literal">True</code>, an underscore in the
label text indicates the next character should be underlined and used for the
mnemonic accelerator key if it is the first character so
marked. Available in PyGTK 2.4 and above.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widget</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widget and sets the text of the menu item label to the value of
<em class="parameter"><code>label</code></em>. If <em class="parameter"><code>label</code></em> is
<code class="literal">None</code> no label is created for the menu item. The text of
label is parsed for underscore characters that indicate that the next
character is a mnemonic accelerator.</p><p>In PyGTK 2.4 and above the <em class="parameter"><code>use_underline</code></em>
parameter is available and defaults to <code class="literal">True</code>. If
<em class="parameter"><code>use_underline</code></em> is set to <code class="literal">False</code> the
label text will not be parsed for mnemonic characters.</p></div><div class="refsect1" title="Methods"><a name="id3792461"></a><h2>Methods</h2><div class="refsect2" title="gtk.MenuItem.set_submenu"><a name="method-gtkmenuitem--set-submenu"></a><h3>gtk.MenuItem.set_submenu</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_submenu</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>submenu</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>submenu</code></strong> :</span></p></td><td>the menu to use as the
submenu</td></tr></tbody></table><p>The <code class="methodname">set_submenu</code>() method sets the menu
specified by <em class="parameter"><code>submenu</code></em> as the submenu for the menu
item.</p></div><div class="refsect2" title="gtk.MenuItem.get_submenu"><a name="method-gtkmenuitem--get-submenu"></a><h3>gtk.MenuItem.get_submenu</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_submenu</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 submenu for this menu item, or
<code class="literal">None</code> if there is no submenu.</td></tr></tbody></table><p>The <code class="methodname">get_submenu</code>() method returns the
submenu widget associated with this menu item. If there is no submenu this
method returns <code class="literal">None</code>. See <a class="link" href="class-gtkmenuitem.html#method-gtkmenuitem--set-submenu" title="gtk.MenuItem.set_submenu"><code class="methodname">set_submenu</code>()</a>.</p></div><div class="refsect2" title="gtk.MenuItem.remove_submenu"><a name="method-gtkmenuitem--remove-submenu"></a><h3>gtk.MenuItem.remove_submenu</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_submenu</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">remove_submenu</code>() method removes the
submenu associated with the menu item.</p></div><div class="refsect2" title="gtk.MenuItem.select"><a name="method-gtkmenuitem--select"></a><h3>gtk.MenuItem.select</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">select</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">select</code>() method emits the "select"
signal on the menu item.</p></div><div class="refsect2" title="gtk.MenuItem.deselect"><a name="method-gtkmenuitem--deselect"></a><h3>gtk.MenuItem.deselect</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">deselect</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">deselect</code>() method emits the
"deselect" signal on the menu item.</p></div><div class="refsect2" title="gtk.MenuItem.activate"><a name="method-gtkmenuitem--activate"></a><h3>gtk.MenuItem.activate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">activate</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">activate</code>() method emits the
"activate" signal on the menu item.</p></div><div class="refsect2" title="gtk.MenuItem.toggle_size_request"><a name="method-gtkmenuitem--toggle-size-request"></a><h3>gtk.MenuItem.toggle_size_request</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">toggle_size_request</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 size requisition</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">toggle_size_request</code>() method emits
the "toggle-size-request" signal on the menuitem and returns the size
requested for the menuitem.</p></div><div class="refsect2" title="gtk.MenuItem.toggle_size_allocate"><a name="method-gtkmenuitem--toggle-size-allocate"></a><h3>gtk.MenuItem.toggle_size_allocate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">toggle_size_allocate</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>allocation</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>allocation</code></strong> :</span></p></td><td>the allocation size for the menu
item</td></tr></tbody></table><p>The <code class="methodname">toggle_size_allocate</code>() method emits
the "toggle-size-allocate" signal on the menu item.</p></div><div class="refsect2" title="gtk.MenuItem.set_right_justified"><a name="method-gtkmenuitem--set-right-justified"></a><h3>gtk.MenuItem.set_right_justified</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_right_justified</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>right_justified</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>right_justified</code></strong> :</span></p></td><td>if <code class="literal">True</code> the menu item will
appear at the far right if added to a menu bar.</td></tr></tbody></table><p>The <code class="methodname">set_right_justified</code>() method sets
the justification of the menu item according to the value of
<em class="parameter"><code>right_justified</code></em>. If
<em class="parameter"><code>right_justified</code></em> is <code class="literal">True</code> the menu
item will appear at the right side of a menu bar. If the widget layout is
reversed for a right-to-left language like Hebrew or Arabic,
right-justified-menu-items appear on the left.</p></div><div class="refsect2" title="gtk.MenuItem.get_right_justified"><a name="method-gtkmenuitem--get-right-justified"></a><h3>gtk.MenuItem.get_right_justified</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_right_justified</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the menu item will
appear at the far right if added to a menu bar.</td></tr></tbody></table><p>The <code class="methodname">get_right_justified</code>() method gets
the justification of the menu item. If <code class="literal">True</code> the menu item
appears justified at the right side of the menu bar.</p></div><div class="refsect2" title="gtk.MenuItem.set_accel_path"><a name="method-gtkmenuitem--set-accel-path"></a><h3>gtk.MenuItem.set_accel_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_accel_path</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_path</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>accel_path</code></strong> :</span></p></td><td>the accelerator path, corresponding to this
menu item</td></tr></tbody></table><p>The <code class="methodname">set_accel_path</code>() method sets the
accelerator path on the menu item. The accelerator path provides access to
the menu item's accelerator allowing user changes to be identified and saved
to persistent storage. See also the <a class="link" href="class-gtkmenu.html#method-gtkmenu--set-accel-path" title="gtk.Menu.set_accel_path"><code class="methodname">gtk.Menu.set_accel_path</code>()</a>
method for a more convenient variant of this function. This method is a
convenience wrapper that handles calling <a class="link" href="class-gtkwidget.html#method-gtkwidget--set-accel-path" title="gtk.Widget.set_accel_path"><code class="methodname">gtk.Widget.set_accel_path</code>()</a>
with the appropriate accelerator group for the menu item.</p></div><div class="refsect2" title="gtk.MenuItem.get_accel_path"><a name="method-gtkmenuitem--get-accel-path"></a><h3>gtk.MenuItem.get_accel_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_accel_path</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the accelerator path corresponding to this menu
item's functionality, or <code class="literal">None</code> if not set </td></tr></tbody></table><p>
The <code class="methodname">get_accel_path</code>() method gets the accelerator
path that was previously set on menu_item.
</p></div><div class="refsect2" title="gtk.MenuItem.set_label"><a name="method-gtkmenuitem--set-label"></a><h3>gtk.MenuItem.set_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_label</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>label</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>label</code></strong> :</span></p></td><td>the text you want to set.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.16 and above.</p></div><p>The <code class="methodname">set_label</code>() method sets the text
specified by <em class="parameter"><code>label</code></em> on the menu_item label .</p></div><div class="refsect2" title="gtk.MenuItem.get_label"><a name="method-gtkmenuitem--get-label"></a><h3>gtk.MenuItem.get_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_label</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The text in the menu_item label.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.16 and above.</p></div><p>The <code class="methodname">get_label</code>() method gets the text in the menu_item label.</p></div><div class="refsect2" title="gtk.MenuItem.set_use_underline"><a name="method-gtkmenuitem--set-use-underline"></a><h3>gtk.MenuItem.set_use_underline</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_underline</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</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>setting</code></strong> :</span></p></td><td><code class="literal">True</code> if underlines in the text indicate mnemonics.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.16 and above.</p></div><p>The <code class="methodname">set_use_underline</code>() method gets whether an underline in the text
indicates the next character should be used for the mnemonic accelerator key.</p></div><div class="refsect2" title="gtk.MenuItem.get_use_underline"><a name="method-gtkmenuitem--get-use-underline"></a><h3>gtk.MenuItem.get_use_underline</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_underline</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 an embedded underline in the label indicates the mnemonic accelerator key.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.16 and above.</p></div><p>The <code class="methodname">get_use_underline</code>() method checks if an underline in the text indicates
the next character should be used for the mnemonic accelerator key.</p></div></div><div class="refsect1" title="Signals"><a name="id3793574"></a><h2>Signals</h2><div class="refsect2" title='The "activate" gtk.MenuItem Signal'><a name="signal-gtkmenuitem--activate"></a><h3>The "activate" gtk.MenuItem Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</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>menuitem</code></em> :</span></p></td><td>the menuitem that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "activate" signal is emitted when the menu item is
activated.</p></div><div class="refsect2" title='The "activate-item" gtk.MenuItem Signal'><a name="signal-gtkmenuitem--activate-item"></a><h3>The "activate-item" gtk.MenuItem Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</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>menuitem</code></em> :</span></p></td><td>the menuitem that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "activate-item" signal is emitted when the menu item is
activated, but also if the menu item has a submenu. For normal applications,
the relevant signal is "activate".</p></div><div class="refsect2" title='The "toggle-size-allocate" gtk.MenuItem Signal'><a name="signal-gtkmenuitem--toggle-size-allocate"></a><h3>The "toggle-size-allocate" gtk.MenuItem Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>allocation</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>menuitem</code></em> :</span></p></td><td>the menuitem that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>allocation</code></em> :</span></p></td><td>the size allocation for the
menuitem</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 "toggle-size-allocate" signal is emitted when the size
allocation is changed.</p></div><div class="refsect2" title='The "toggle-size-request" gtk.MenuItem Signal'><a name="signal-gtkmenuitem--toggle-size-request"></a><h3>The "toggle-size-request" gtk.MenuItem Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>menuitem</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>requisition</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>menuitem</code></em> :</span></p></td><td>the menuitem that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>requisition</code></em> :</span></p></td><td>the pointer to the location to put the size
request</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 "toggle-size-request" signal is emitted when a new size
request is needed.</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-gtkmenubar.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-gtkmenushell.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.MenuBar </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.MenuShell</td></tr></table></div></body></html>
|