~ubuntu-branches/ubuntu/natty/pygtk/natty-proposed

« back to all changes in this revision

Viewing changes to docs/html/class-gtkoptionmenu.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-01-07 11:08:47 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107110847-f5av7e1ttudh7ra6
Tags: 2.17.0-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.OptionMenu</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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-gtkobject.html" title="gtk.Object"><link rel="next" href="class-gtkpagesetup.html" title="gtk.PageSetup"></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.OptionMenu</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkobject.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkpagesetup.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkoptionmenu"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.OptionMenu</h2><p>gtk.OptionMenu — a widget used to provide a list of valid choices.</p></div><div class="refsect1" lang="en"><a name="id3605589"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.OptionMenu</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkbutton.html" title="gtk.Button">gtk.Button</a></span></span>):
2
 
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#constructor-gtkoptionmenu" title="Constructor">gtk.OptionMenu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--get-menu" title="gtk.OptionMenu.get_menu">get_menu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-menu" title="gtk.OptionMenu.set_menu">set_menu</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>menu</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--remove-menu" title="gtk.OptionMenu.remove_menu">remove_menu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--get-history" title="gtk.OptionMenu.get_history">get_history</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-history" title="gtk.OptionMenu.set_history">set_history</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3605755"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.OptionMenu</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkobject.html" title="gtk.Object"><link rel="next" href="class-gtkpagesetup.html" title="gtk.PageSetup"></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.OptionMenu</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkobject.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkpagesetup.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.OptionMenu"><a name="class-gtkoptionmenu"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.OptionMenu</h2><p>gtk.OptionMenu — a widget used to provide a list of valid choices.</p></div><div class="refsect1" title="Synopsis"><a name="id3915493"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.OptionMenu</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkbutton.html" title="gtk.Button">gtk.Button</a></span></span>):
 
2
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#constructor-gtkoptionmenu" title="Constructor">gtk.OptionMenu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--get-menu" title="gtk.OptionMenu.get_menu">get_menu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-menu" title="gtk.OptionMenu.set_menu">set_menu</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>menu</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--remove-menu" title="gtk.OptionMenu.remove_menu">remove_menu</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--get-history" title="gtk.OptionMenu.get_history">get_history</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-history" title="gtk.OptionMenu.set_history">set_history</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3915658"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
3
3
  +-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
4
4
    +-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
5
5
      +-- <a class="link" href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
6
6
        +-- <a class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
7
7
          +-- <a class="link" href="class-gtkbutton.html" title="gtk.Button">gtk.Button</a>
8
8
            +-- <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu">gtk.OptionMenu</a>
9
 
</pre></div><div class="refsect1" lang="en"><a name="id3605812"></a><h2>Implemented Interfaces</h2><p>
 
9
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id3915715"></a><h2>Implemented Interfaces</h2><p>
10
10
                        <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
11
11
                        implements 
12
12
                        <a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
13
 
                </p></div><div class="refsect1" lang="en"><a name="properties-gtkoptionmenu"></a><h2>gtk.OptionMenu 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><p><a class="link" href="class-gtkbutton.html#properties-gtkbutton" title="gtk.Button Properties">gtk.Button 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><col><col></colgroup><tbody><tr valign="top"><td valign="top">"menu"</td><td valign="top">Read-Write</td><td valign="top">The menu of options.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="style-properties-gtkoptionmenu"></a><h2>gtk.OptionMenu 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><p><a class="link" href="class-gtkbutton.html#style-properties-gtkbutton" title="gtk.Button Style Properties">gtk.Button 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><col><col></colgroup><tbody><tr valign="top"><td valign="top">"indicator-size"</td><td valign="top">Read</td><td valign="top">The size of the dropdown indicator</td></tr><tr valign="top"><td valign="top">"indicator-spacing"</td><td valign="top">Read</td><td valign="top">The spacing around the indicator.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkoptionmenu"></a><h2>gtk.OptionMenu 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-gtkbutton.html#signal-prototypes-gtkbutton" title="gtk.Button Signal Prototypes">gtk.Button 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-gtkoptionmenu.html#signal-gtkoptionmenu--changed" title='The "changed" gtk.OptionMenu Signal'>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>optionmenu</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" lang="en"><a name="id3606170"></a><h2>Description</h2><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
 
13
                </p></div><div class="refsect1" title="gtk.OptionMenu Properties"><a name="properties-gtkoptionmenu"></a><h2>gtk.OptionMenu 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><p><a class="link" href="class-gtkbutton.html#properties-gtkbutton" title="gtk.Button Properties">gtk.Button 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">"menu"</td><td valign="top">Read-Write</td><td valign="top">The menu of options.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.OptionMenu Style Properties"><a name="style-properties-gtkoptionmenu"></a><h2>gtk.OptionMenu 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><p><a class="link" href="class-gtkbutton.html#style-properties-gtkbutton" title="gtk.Button Style Properties">gtk.Button 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">"indicator-size"</td><td valign="top">Read</td><td valign="top">The size of the dropdown indicator</td></tr><tr valign="top"><td valign="top">"indicator-spacing"</td><td valign="top">Read</td><td valign="top">The spacing around the indicator.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.OptionMenu Signal Prototypes"><a name="signal-prototypes-gtkoptionmenu"></a><h2>gtk.OptionMenu 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-gtkbutton.html#signal-prototypes-gtkbutton" title="gtk.Button Signal Prototypes">gtk.Button 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-gtkoptionmenu.html#signal-gtkoptionmenu--changed" title='The "changed" gtk.OptionMenu Signal'>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>optionmenu</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="id3916074"></a><h2>Description</h2><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
14
14
is deprecated in PyGTK 2.4; use the <a class="link" href="class-gtkcombobox.html" title="gtk.ComboBox"><code class="classname">gtk.ComboBox</code></a>
15
15
instead.</p></div><p>A <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
16
16
is a widget allows the user to choose from a list of valid choices from an
18
18
displays the last selected choice. When activated (clicked) the <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
19
19
displays a popup <a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> which allows
20
20
the user to make a new choice. Using a <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
21
 
is simple:</p><div class="itemizedlist"><ul type="disc"><li>build a <a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> using <a class="link" href="class-gtkmenu.html#constructor-gtkmenu" title="Constructor"><code class="methodname">gtk.Menu</code>()</a></li><li>then append menu items to it using <a class="link" href="class-gtkmenushell.html#method-gtkmenushell--append" title="gtk.MenuShell.append"><code class="methodname">gtk.MenuShell.append</code>()</a></li><li>associate the menu with the option menu using <a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-menu" title="gtk.OptionMenu.set_menu"><code class="methodname">set_menu</code>()</a></li><li>set the selected menu item with <a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-history" title="gtk.OptionMenu.set_history"><code class="methodname">set_history</code>()</a></li><li>connect to the "changed" signal on the option menu; in the
22
 
"changed" signal</li><li>check the new selected menu item with <a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--get-history" title="gtk.OptionMenu.get_history"><code class="methodname">get_history</code>()</a>.</li></ul></div></div><div class="refsect1" lang="en"><a name="constructor-gtkoptionmenu"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.OptionMenu</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new optionmenu widget</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
23
 
widget.</p></div><div class="refsect1" lang="en"><a name="id3606402"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkoptionmenu--get-menu"></a><h3>gtk.OptionMenu.get_menu</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_menu</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a menu widget or <code class="literal">None</code> if no
 
21
is simple:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">build a <a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> using <a class="link" href="class-gtkmenu.html#constructor-gtkmenu" title="Constructor"><code class="methodname">gtk.Menu</code>()</a></li><li class="listitem">then append menu items to it using <a class="link" href="class-gtkmenushell.html#method-gtkmenushell--append" title="gtk.MenuShell.append"><code class="methodname">gtk.MenuShell.append</code>()</a></li><li class="listitem">associate the menu with the option menu using <a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-menu" title="gtk.OptionMenu.set_menu"><code class="methodname">set_menu</code>()</a></li><li class="listitem">set the selected menu item with <a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--set-history" title="gtk.OptionMenu.set_history"><code class="methodname">set_history</code>()</a></li><li class="listitem">connect to the "changed" signal on the option menu; in the
 
22
"changed" signal</li><li class="listitem">check the new selected menu item with <a class="link" href="class-gtkoptionmenu.html#method-gtkoptionmenu--get-history" title="gtk.OptionMenu.get_history"><code class="methodname">get_history</code>()</a>.</li></ul></div></div><div class="refsect1" title="Constructor"><a name="constructor-gtkoptionmenu"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.OptionMenu</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new optionmenu widget</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>
 
23
widget.</p></div><div class="refsect1" title="Methods"><a name="id3916305"></a><h2>Methods</h2><div class="refsect2" title="gtk.OptionMenu.get_menu"><a name="method-gtkoptionmenu--get-menu"></a><h3>gtk.OptionMenu.get_menu</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_menu</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a menu widget or <code class="literal">None</code> if no
24
24
menu is associated</td></tr></tbody></table><p>The <code class="methodname">get_menu</code>() method returns the menu
25
25
that is associated with the optionmenu or <code class="literal">None</code> if no menu
26
 
is associated.</p></div><div class="refsect2" lang="en"><a name="method-gtkoptionmenu--set-menu"></a><h3>gtk.OptionMenu.set_menu</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_menu</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>menu</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>menu</code></strong> :</span></p></td><td>a menu to be associated with the
 
26
is associated.</p></div><div class="refsect2" title="gtk.OptionMenu.set_menu"><a name="method-gtkoptionmenu--set-menu"></a><h3>gtk.OptionMenu.set_menu</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_menu</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>menu</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>menu</code></strong> :</span></p></td><td>a menu to be associated with the
27
27
optionmenu</td></tr></tbody></table><p>The <code class="methodname">set_menu</code>() method associates the
28
28
<a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> widget
29
29
specified by <em class="parameter"><code>menu</code></em> with the optionmenu thus providing
30
30
the way for a user to select a new choice. A simple menu, avoiding the use
31
 
of tearoff menu items, submenus, and accelerators, should be used.</p></div><div class="refsect2" lang="en"><a name="method-gtkoptionmenu--remove-menu"></a><h3>gtk.OptionMenu.remove_menu</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">remove_menu</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">remove_menu</code>() method removes the
32
 
currently associated menu from the optionmenu.</p></div><div class="refsect2" lang="en"><a name="method-gtkoptionmenu--get-history"></a><h3>gtk.OptionMenu.get_history</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_history</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 index of the selected menu item, or -1 if
 
31
of tearoff menu items, submenus, and accelerators, should be used.</p></div><div class="refsect2" title="gtk.OptionMenu.remove_menu"><a name="method-gtkoptionmenu--remove-menu"></a><h3>gtk.OptionMenu.remove_menu</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">remove_menu</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">remove_menu</code>() method removes the
 
32
currently associated menu from the optionmenu.</p></div><div class="refsect2" title="gtk.OptionMenu.get_history"><a name="method-gtkoptionmenu--get-history"></a><h3>gtk.OptionMenu.get_history</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_history</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 index of the selected menu item, or -1 if
33
33
there are no menu items</td></tr></tbody></table><p>The <code class="methodname">get_history</code>() method returns the
34
34
index of the currently selected menu item or -1 if there are no menu items.
35
 
The menu items are numbered from top to bottom, starting with 0.</p></div><div class="refsect2" lang="en"><a name="method-gtkoptionmenu--set-history"></a><h3>gtk.OptionMenu.set_history</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_history</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</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>index</code></strong> :</span></p></td><td>the index of the menu item to display as the
 
35
The menu items are numbered from top to bottom, starting with 0.</p></div><div class="refsect2" title="gtk.OptionMenu.set_history"><a name="method-gtkoptionmenu--set-history"></a><h3>gtk.OptionMenu.set_history</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_history</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</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>index</code></strong> :</span></p></td><td>the index of the menu item to display as the
36
36
selected optionmenu choice</td></tr></tbody></table><p>The <code class="methodname">set_history</code>() method selects the
37
37
menu item specified by <em class="parameter"><code>index</code></em> as the displayed
38
 
optionmenu choice.</p></div></div><div class="refsect1" lang="en"><a name="id3606749"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkoptionmenu--changed"></a><h3>The "changed" gtk.OptionMenu Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>optionmenu</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>optionmenu</code></em> :</span></p></td><td>the optionmenu that received the
 
38
optionmenu choice.</p></div></div><div class="refsect1" title="Signals"><a name="id3916652"></a><h2>Signals</h2><div class="refsect2" title='The "changed" gtk.OptionMenu Signal'><a name="signal-gtkoptionmenu--changed"></a><h3>The "changed" gtk.OptionMenu Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>optionmenu</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>optionmenu</code></em> :</span></p></td><td>the optionmenu that received the
39
39
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
40
40
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
41
41
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if