File: class-gtkitemfactory.html

package info (click to toggle)
pygtk 2.24.0-5.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 26,760 kB
  • ctags: 8,260
  • sloc: xml: 182,079; sh: 10,297; python: 10,161; ansic: 2,861; makefile: 1,358
file content (95 lines) | stat: -rw-r--r-- 30,012 bytes parent folder | download | duplicates (3)
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.ItemFactory</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-gtkitem.html" title="gtk.Item"><link rel="next" href="class-gtklabel.html" title="gtk.Label"></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.ItemFactory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkitem.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtklabel.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.ItemFactory"><a name="class-gtkitemfactory"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.ItemFactory</h2><p>gtk.ItemFactory — creates menus, menubars and option menus from a data
description.</p></div><div class="refsect1" title="Synopsis"><a name="id3768180"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ItemFactory</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtkitemfactory.html#constructor-gtkitemfactory" title="Constructor">gtk.ItemFactory</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>container_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--construct" title="gtk.ItemFactory.construct">construct</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>container_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--get-item" title="gtk.ItemFactory.get_item">get_item</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--get-widget" title="gtk.ItemFactory.get_widget">get_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--get-widget-by-action" title="gtk.ItemFactory.get_widget_by_action">get_widget_by_action</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--get-item-by-action" title="gtk.ItemFactory.get_item_by_action">get_item_by_action</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--create-items" title="gtk.ItemFactory.create_items">create_items</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>entries</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback_data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--delete-item" title="gtk.ItemFactory.delete_item">delete_item</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--popup" title="gtk.ItemFactory.popup">popup</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>mouse_button</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>time</code></strong></span><span class="initializer">=GDK_CURRENT_TIME</span></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-gtkitemfactory.html#function-gtk--item-factory-from-widget" title="gtk.item_factory_from_widget">gtk.item_factory_from_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkitemfactory.html#function-gtk--item-factory-path-from-widget" title="gtk.item_factory_path_from_widget">gtk.item_factory_path_from_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3768639"></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-gtkitemfactory.html" title="gtk.ItemFactory">gtk.ItemFactory</a>
</pre></div><div class="refsect1" title="gtk.ItemFactory Properties"><a name="properties-gtkitemfactory"></a><h2>gtk.ItemFactory Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p></div><div class="refsect1" title="gtk.ItemFactory Signal Prototypes"><a name="signal-prototypes-gtkitemfactory"></a><h2>gtk.ItemFactory 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></div><div class="refsect1" title="Description"><a name="id3768718"></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-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
is deprecated in PyGTK 2.4 and above. The <a class="link" href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a>
should be used instead.</p></div><p>The <a class="link" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
provides a convenient way to create and manage menus, menubars and option
menus from a data description. The data description is a tuple or list
containing a list of entry tuples that each describe an individual menu,
menuitem, etc. Each entry tuple may contain the following entry fields
though only the path must be specified; the other fields are
optional:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">A path that defines the logical position of the menu or
menuitem in the menu hierarchy. a path is similar to a file path in that it
starts with a slash (/) character and all components are joined by a slash
(/) character. The last component may have an underscore that indicates that
the following character is to be used as the accelerator mnemonic.</li><li class="listitem"><p class="simpara">An accelerator that defines a key sequence that will
activate the menuitem. The key sequence is a set of zero or more modifiers
followed by a single key. The modifier keys are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"&lt;alt&gt;"</span></p></td><td><span class="keycap"><strong>Alt-L</strong></span>or
<span class="keycap"><strong>Alt-R</strong></span></td></tr><tr><td><p><span class="term">"&lt;ctl&gt;", </span><span class="term">"&lt;ctrl&gt;", </span><span class="term">"&lt;control&gt;"</span></p></td><td><span class="keycap"><strong>Ctrl-L</strong></span>or
<span class="keycap"><strong>Ctrl-R</strong></span></td></tr><tr><td><p><span class="term">"&lt;shift&gt;", </span><span class="term">"&lt;shft&gt;"</span></p></td><td><span class="keycap"><strong>Shift-L</strong></span>or
<span class="keycap"><strong>Shift-R</strong></span></td></tr></tbody></table></li><li class="listitem"><p class="simpara">A callback function or method that will be invoked when the
menu item is activated or the accelerator key sequence is pressed. The
callback function is defined as either:</p><pre class="programlisting">
    def callback(callback_data, callback_action, widget)
    def callback(callback_action, widget)
</pre><p class="simpara">where <em class="parameter"><code>callback_action</code></em> is the
callback action defined below, <em class="parameter"><code>callback_data</code></em> is the
data passed with the <a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--create-items" title="gtk.ItemFactory.create_items"><code class="methodname">create_items</code>()</a> 
method and <em class="parameter"><code>widget</code></em> is the menuitem widget. The second
definition must be used if no <em class="parameter"><code>callback_data</code></em> argument
is specified by the call to <a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--create-items" title="gtk.ItemFactory.create_items"><code class="methodname">create_items</code>()</a>.</p></li><li class="listitem">A callback action that is an arbitrary integer
value.</li><li class="listitem"><p class="simpara">An item type is a string describing the type of the
item:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"None", </span><span class="term">"", </span><span class="term">"Item"</span></p></td><td>a simple menu item</td></tr><tr><td><p><span class="term">"&lt;Title&gt;"</span></p></td><td>a title item</td></tr><tr><td><p><span class="term">"&lt;ImageItem&gt;"</span></p></td><td>an image item</td></tr><tr><td><p><span class="term">"&lt;StockItem&gt;"</span></p></td><td>an item holding a stock image</td></tr><tr><td><p><span class="term">"&lt;CheckItem&gt;"</span></p></td><td>a check item</td></tr><tr><td><p><span class="term">"&lt;ToggleItem&gt;"</span></p></td><td>a toggle item</td></tr><tr><td><p><span class="term">"&lt;RadioItem&gt;"</span></p></td><td>a radio item</td></tr><tr><td><p><span class="term">&lt;path&gt;</span></p></td><td>the path of a radio item group to add item
to</td></tr><tr><td><p><span class="term">"&lt;Separator&gt;"</span></p></td><td>a separator</td></tr><tr><td><p><span class="term">"&lt;Tearoff&gt;"</span></p></td><td>a tearoff separator</td></tr><tr><td><p><span class="term">"&lt;Branch&gt;"</span></p></td><td>an item to hold sub items</td></tr><tr><td><p><span class="term">"&lt;LastBranch&gt;"</span></p></td><td>a right justified item to hold sub items</td></tr></tbody></table></li><li class="listitem">extra data that is either a <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a> or a
stock ID</li></ul></div></div><div class="refsect1" title="Constructor"><a name="constructor-gtkitemfactory"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.ItemFactory</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>container_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</code></strong></span><span class="initializer">=None</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>container_type</code></strong> :</span></p></td><td>the kind of menu to create; one of: <a class="link" href="class-gtkmenubar.html" title="gtk.MenuBar"><code class="classname">gtk.MenuBar</code></a>, <a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> or <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>path</code></strong> :</span></p></td><td>the path of the new item factory, a string of the
form <code class="literal">"&lt;name&gt;"</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_group</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
to which the accelerators for the menu items will be added, or
<code class="literal">None</code> to create a new one</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-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a></td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
object.</p></div><div class="refsect1" title="Methods"><a name="id3769376"></a><h2>Methods</h2><div class="refsect2" title="gtk.ItemFactory.construct"><a name="method-gtkitemfactory--construct"></a><h3>gtk.ItemFactory.construct</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">construct</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>container_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</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>container_type</code></strong> :</span></p></td><td>the kind of menu to create; one of: <a class="link" href="class-gtkmenubar.html" title="gtk.MenuBar"><code class="classname">gtk.MenuBar</code></a>, <a class="link" href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> or <a class="link" href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><code class="classname">gtk.OptionMenu</code></a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>path</code></strong> :</span></p></td><td>the path of the item factory, a string of the
form <code class="literal">"&lt;name&gt;"</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_group</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
to which the accelerators for the menu items will be added, or
<code class="literal">None</code> to create a new one</td></tr></tbody></table><p>The <code class="methodname">construct</code>() method initializes an
item factory.</p></div><div class="refsect2" title="gtk.ItemFactory.get_item"><a name="method-gtkitemfactory--get-item"></a><h3>gtk.ItemFactory.get_item</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_item</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>path</code></strong> :</span></p></td><td>the path to the menu item</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the menu item with the specified
<em class="parameter"><code>path</code></em>, or <code class="literal">None</code> if
<em class="parameter"><code>path</code></em> doesn't lead to a menu item</td></tr></tbody></table><p>The <code class="methodname">get_item</code>() method returns the menu
item that corresponds to <em class="parameter"><code>path</code></em>. If the widget
corresponding to <em class="parameter"><code>path</code></em> is a menu item that opens a
submenu, then the item is returned. If you are interested in the submenu,
use the <a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--get-widget" title="gtk.ItemFactory.get_widget"><code class="methodname">get_widget</code>()</a> 
method instead.</p></div><div class="refsect2" title="gtk.ItemFactory.get_widget"><a name="method-gtkitemfactory--get-widget"></a><h3>gtk.ItemFactory.get_widget</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>path</code></strong> :</span></p></td><td>the path to the widget</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the widget associated with the specified
<em class="parameter"><code>path</code></em>, or <code class="literal">None</code> if
<em class="parameter"><code>path</code></em> doesn't lead to a widget</td></tr></tbody></table><p>The <code class="methodname">get_widget</code>() method returns the
widget that corresponds to <em class="parameter"><code>path</code></em>. If the widget
corresponding to <em class="parameter"><code>path</code></em> is a menu item that opens a
submenu, then the submenu is returned. If you are interested in the menu
item, use <a class="link" href="class-gtkitemfactory.html#method-gtkitemfactory--get-item" title="gtk.ItemFactory.get_item"><code class="methodname">get_item</code>()</a> 
instead.</p></div><div class="refsect2" title="gtk.ItemFactory.get_widget_by_action"><a name="method-gtkitemfactory--get-widget-by-action"></a><h3>gtk.ItemFactory.get_widget_by_action</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_widget_by_action</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</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>action</code></strong> :</span></p></td><td>a callback action value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the widget that corresponds to the given
action, or <code class="literal">None</code> if no widget was
found</td></tr></tbody></table><p>The <code class="methodname">get_widget_by_action</code>() method
returns the widget that is associated with the specified
<em class="parameter"><code>action</code></em>. If there are multiple items with the same
<em class="parameter"><code>action</code></em>, the result is undefined.</p></div><div class="refsect2" title="gtk.ItemFactory.get_item_by_action"><a name="method-gtkitemfactory--get-item-by-action"></a><h3>gtk.ItemFactory.get_item_by_action</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_item_by_action</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</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>action</code></strong> :</span></p></td><td>a callback action value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the menu item that corresponds to the specified
<em class="parameter"><code>action</code></em>, or <code class="literal">None</code> if no menu item
was found</td></tr></tbody></table><p>The <code class="methodname">get_item_by_action</code>() returns the
menu item that is associated with the specified
<em class="parameter"><code>action</code></em>.</p></div><div class="refsect2" title="gtk.ItemFactory.create_items"><a name="method-gtkitemfactory--create-items"></a><h3>gtk.ItemFactory.create_items</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">create_items</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>entries</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback_data</code></strong></span><span class="initializer">=None</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>entries</code></strong> :</span></p></td><td>a tuple or list of item factory
entries</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>callback_data</code></strong> :</span></p></td><td>optional data passed to the callback functions
of all entries</td></tr></tbody></table><p>The <code class="methodname">create_items</code>() method creates the
menu items from the specified item factory <em class="parameter"><code>entries</code></em>.
If no <em class="parameter"><code>callback_data</code></em> is specified it will not be
passed to the callback functions i.e the callback functions will be passed
one less argument.</p></div><div class="refsect2" title="gtk.ItemFactory.delete_item"><a name="method-gtkitemfactory--delete-item"></a><h3>gtk.ItemFactory.delete_item</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">delete_item</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>path</code></strong> :</span></p></td><td>a path</td></tr></tbody></table><p>The <code class="methodname">delete_item</code>() method deletes the
menu item that was created with the specified
<em class="parameter"><code>path</code></em>.</p></div><div class="refsect2" title="gtk.ItemFactory.popup"><a name="method-gtkitemfactory--popup"></a><h3>gtk.ItemFactory.popup</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">popup</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>mouse_button</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>time</code></strong></span><span class="initializer">=0L</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>x</code></strong> :</span></p></td><td>the x position</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y position</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>mouse_button</code></strong> :</span></p></td><td>the mouse button that was pressed to initiate
this action</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>time</code></strong> :</span></p></td><td>an optional timestamp for this action; default
is 0L which means use the current time</td></tr></tbody></table><p>The <code class="methodname">popup</code>() method pops up the menu
constructed from the item factory at the specified location
(<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>). This method is
generally invoked in response to a "button_press_event" so the arguments are
retrieved from the event information.</p></div></div><div class="refsect1" title="Functions"><a name="id3770416"></a><h2>Functions</h2><div class="refsect2" title="gtk.item_factory_from_widget"><a name="function-gtk--item-factory-from-widget"></a><h3>gtk.item_factory_from_widget</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.item_factory_from_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>widget</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a>
object</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
	  that created <em class="parameter"><code>widget</code></em></td></tr></tbody></table><p>The <code class="function">gtk.item_factory_from_widget</code>() function
returns the <a class="link" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
object that created the <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a> specified
by <em class="parameter"><code>widget</code></em>.</p></div><div class="refsect2" title="gtk.item_factory_path_from_widget"><a name="function-gtk--item-factory-path-from-widget"></a><h3>gtk.item_factory_path_from_widget</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.item_factory_path_from_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>widget</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a>
object</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the full path to the <a class="link" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
that created <em class="parameter"><code>widget</code></em></td></tr></tbody></table><p>The <code class="function">gtk.item_factory_path_from_widget</code>()
function returns the full path to the <a class="link" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><code class="classname">gtk.ItemFactory</code></a>
that created the <a class="link" href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a> specified
by <em class="parameter"><code>widget</code></em>.</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-gtkitem.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-gtklabel.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Item </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.Label</td></tr></table></div></body></html>