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=ISO-8859-1"><title>gtk.ItemFactory</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.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="previous" 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" lang="en"><a name="class-gtkitemfactory"></a><div class="titlepage"><div></div><div></div></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" lang="en"><a name="id3450970"></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 href="class-gtkobject.html" title="gtk.Object">gtk.Object</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkitemfactory.html#constructor-gtkitemfactory" title="Constructor">gtk.ItemFactory</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>container_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_group</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkitemfactory.html#method-gtkitemfactory--construct" title="gtk.ItemFactory.construct">construct</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>container_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_group</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkitemfactory.html#method-gtkitemfactory--get-item" title="gtk.ItemFactory.get_item">get_item</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkitemfactory.html#method-gtkitemfactory--get-widget" title="gtk.ItemFactory.get_widget">get_widget</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a 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"><b class="parameter"><tt>action</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a 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"><b class="parameter"><tt>action</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkitemfactory.html#method-gtkitemfactory--create-items" title="gtk.ItemFactory.create_items">create_items</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>entries</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback_data</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkitemfactory.html#method-gtkitemfactory--delete-item" title="gtk.ItemFactory.delete_item">delete_item</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkitemfactory.html#method-gtkitemfactory--popup" title="gtk.ItemFactory.popup">popup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>mouse_button</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>time</tt></b></span><span class="initializer">=GDK_CURRENT_TIME</span></span>)</code><br></pre></td></tr></table><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
<span class="bold"><b>Functions</b></span>
<code class="methodsynopsis"> def <span class="methodname"><a 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"><b class="parameter"><tt>widget</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a 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"><b class="parameter"><tt>widget</tt></b></span></span>)</code></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3451251"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkitemfactory.html" title="gtk.ItemFactory">gtk.ItemFactory</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3451276"></a><h2>Description</h2><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a>
is deprecated in PyGTK 2.4 and above. The <a href="class-gtkuimanager.html" title="gtk.UIManager"><tt class="classname">gtk.UIManager</tt></a>
should be used instead.</p></div><p>The <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></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 type="disc"><li>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><p>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><span class="term">"<alt>"</span></td><td><span><b class="keycap">Alt-L</b></span>or
<span><b class="keycap">Alt-R</b></span></td></tr><tr><td><span class="term">"<ctl>", </span><span class="term">"<ctrl>", </span><span class="term">"<control>", </span></td><td><span><b class="keycap">Ctrl-L</b></span>or
<span><b class="keycap">Ctrl-R</b></span></td></tr><tr><td><span class="term">"<shift>", </span><span class="term">"<shft>", </span></td><td><span><b class="keycap">Shift-L</b></span>or
<span><b class="keycap">Shift-R</b></span></td></tr></tbody></table></li><li><p>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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
def callback(callback_data, callback_action, widget)
def callback(callback_action, widget)
</pre></td></tr></table><p>where <i class="parameter"><tt>callback_action</tt></i> is the
callback action defined below, <i class="parameter"><tt>callback_data</tt></i> is the
data passed with the <a href="class-gtkitemfactory.html#method-gtkitemfactory--create-items" title="gtk.ItemFactory.create_items"><tt class="methodname">create_items</tt>()</a>
method and <i class="parameter"><tt>widget</tt></i> is the menuitem widget. The second
definition must be used if no <i class="parameter"><tt>callback_data</tt></i> argument
is specified by the call to <a href="class-gtkitemfactory.html#method-gtkitemfactory--create-items" title="gtk.ItemFactory.create_items"><tt class="methodname">create_items</tt>()</a>.</p></li><li>A callback action that is an arbitrary integer
value.</li><li><p>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><span class="term">"None", </span><span class="term">"", </span><span class="term">"Item", </span></td><td>a simple menu item</td></tr><tr><td><span class="term">"<Title>"</span></td><td>a title item</td></tr><tr><td><span class="term">"<ImageItem>"</span></td><td>an image item</td></tr><tr><td><span class="term">"<StockItem>"</span></td><td>an item holding a stock image</td></tr><tr><td><span class="term">"<CheckItem>"</span></td><td>a check item</td></tr><tr><td><span class="term">"<ToggleItem>"</span></td><td>a toggle item</td></tr><tr><td><span class="term">"<RadioItem>"</span></td><td>a radio item</td></tr><tr><td><span class="term"><path></span></td><td>the path of a radio item group to add item
to</td></tr><tr><td><span class="term">"<Separator>"</span></td><td>a separator</td></tr><tr><td><span class="term">"<Tearoff>"</span></td><td>a tearoff separator</td></tr><tr><td><span class="term">"<Branch>"</span></td><td>an item to hold sub items</td></tr><tr><td><span class="term">"<LastBranch>"</span></td><td>a right justified item to hold sub items</td></tr></tbody></table></li><li>extra data that is either a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> or a
stock ID</li></ul></div></div><div class="refsect1" lang="en"><a name="constructor-gtkitemfactory"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.ItemFactory</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>container_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_group</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>container_type</tt></b>:</span></td><td>the kind of menu to create; one of: <a href="class-gtkmenubar.html" title="gtk.MenuBar"><tt class="classname">gtk.MenuBar</tt></a>, <a href="class-gtkmenu.html" title="gtk.Menu"><tt class="classname">gtk.Menu</tt></a> or <a href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><tt class="classname">gtk.OptionMenu</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>the path of the new item factory, a string of the
form <tt class="literal">"<name>"</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>accel_group</tt></b>:</span></td><td>a <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><tt class="classname">gtk.AccelGroup</tt></a>
to which the accelerators for the menu items will be added, or
<tt class="literal">None</tt> to create a new one</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a></td></tr></tbody></table><p>Creates a new <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a>
object.</p></div><div class="refsect1" lang="en"><a name="id3451789"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkitemfactory--construct"></a><h3>gtk.ItemFactory.construct</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">construct</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>container_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_group</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>container_type</tt></b>:</span></td><td>the kind of menu to create; one of: <a href="class-gtkmenubar.html" title="gtk.MenuBar"><tt class="classname">gtk.MenuBar</tt></a>, <a href="class-gtkmenu.html" title="gtk.Menu"><tt class="classname">gtk.Menu</tt></a> or <a href="class-gtkoptionmenu.html" title="gtk.OptionMenu"><tt class="classname">gtk.OptionMenu</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>the path of the item factory, a string of the
form <tt class="literal">"<name>"</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>accel_group</tt></b>:</span></td><td>a <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><tt class="classname">gtk.AccelGroup</tt></a>
to which the accelerators for the menu items will be added, or
<tt class="literal">None</tt> to create a new one</td></tr></tbody></table><p>The <tt class="methodname">construct</tt>() method initializes an
item factory.</p></div><div class="refsect2" lang="en"><a name="method-gtkitemfactory--get-item"></a><h3>gtk.ItemFactory.get_item</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_item</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>the path to the menu item</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the menu item with the specified
<i class="parameter"><tt>path</tt></i>, or <tt class="literal">None</tt> if
<i class="parameter"><tt>path</tt></i> doesn't lead to a menu item</td></tr></tbody></table><p>The <tt class="methodname">get_item</tt>() method returns the menu
item that corresponds to <i class="parameter"><tt>path</tt></i>. If the widget
corresponding to <i class="parameter"><tt>path</tt></i> is a menu item that opens a
submenu, then the item is returned. If you are interested in the submenu,
use the <a href="class-gtkitemfactory.html#method-gtkitemfactory--get-widget" title="gtk.ItemFactory.get_widget"><tt class="methodname">get_widget</tt>()</a>
method instead.</p></div><div class="refsect2" lang="en"><a name="method-gtkitemfactory--get-widget"></a><h3>gtk.ItemFactory.get_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_widget</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>the path to the widget</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the widget associated with the specified
<i class="parameter"><tt>path</tt></i>, or <tt class="literal">None</tt> if
<i class="parameter"><tt>path</tt></i> doesn't lead to a widget</td></tr></tbody></table><p>The <tt class="methodname">get_widget</tt>() method returns the
widget that corresponds to <i class="parameter"><tt>path</tt></i>. If the widget
corresponding to <i class="parameter"><tt>path</tt></i> is a menu item that opens a
submenu, then the submenu is returned. If you are interested in the menu
item, use <a href="class-gtkitemfactory.html#method-gtkitemfactory--get-item" title="gtk.ItemFactory.get_item"><tt class="methodname">get_item</tt>()</a>
instead.</p></div><div class="refsect2" lang="en"><a name="method-gtkitemfactory--get-widget-by-action"></a><h3>gtk.ItemFactory.get_widget_by_action</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_widget_by_action</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>action</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>action</tt></b>:</span></td><td>a callback action value</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the widget that corresponds to the given
action, or <tt class="literal">None</tt> if no widget was
found</td></tr></tbody></table><p>The <tt class="methodname">get_widget_by_action</tt>() method
returns the widget that is associated with the specified
<i class="parameter"><tt>action</tt></i>. If there are multiple items with the same
<i class="parameter"><tt>action</tt></i>, the result is undefined.</p></div><div class="refsect2" lang="en"><a name="method-gtkitemfactory--get-item-by-action"></a><h3>gtk.ItemFactory.get_item_by_action</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_item_by_action</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>action</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>action</tt></b>:</span></td><td>a callback action value</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the menu item that corresponds to the specified
<i class="parameter"><tt>action</tt></i>, or <tt class="literal">None</tt> if no menu item
was found</td></tr></tbody></table><p>The <tt class="methodname">get_item_by_action</tt>() returns the
menu item that is associated with the specified
<i class="parameter"><tt>action</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtkitemfactory--create-items"></a><h3>gtk.ItemFactory.create_items</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">create_items</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>entries</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback_data</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>entries</tt></b>:</span></td><td>a tuple or list of item factory
entries</td></tr><tr><td><span class="term"><b class="parameter"><tt>callback_data</tt></b>:</span></td><td>optional data passed to the callback functions
of all entries</td></tr></tbody></table><p>The <tt class="methodname">create_items</tt>() method creates the
menu items from the specified item factory <i class="parameter"><tt>entries</tt></i>.
If no <i class="parameter"><tt>callback_data</tt></i> 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" lang="en"><a name="method-gtkitemfactory--delete-item"></a><h3>gtk.ItemFactory.delete_item</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">delete_item</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>a path</td></tr></tbody></table><p>The <tt class="methodname">delete_item</tt>() method deletes the
menu item that was created with the specified
<i class="parameter"><tt>path</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtkitemfactory--popup"></a><h3>gtk.ItemFactory.popup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">popup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>mouse_button</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>time</tt></b></span><span class="initializer">=0L</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>x</tt></b>:</span></td><td>the x position</td></tr><tr><td><span class="term"><b class="parameter"><tt>y</tt></b>:</span></td><td>the y position</td></tr><tr><td><span class="term"><b class="parameter"><tt>mouse_button</tt></b>:</span></td><td>the mouse button that was pressed to initiate
this action</td></tr><tr><td><span class="term"><b class="parameter"><tt>time</tt></b>:</span></td><td>an optional timestamp for this action; default
is 0L which means use the current time</td></tr></tbody></table><p>The <tt class="methodname">popup</tt>() method pops up the menu
constructed from the item factory at the specified location
(<i class="parameter"><tt>x</tt></i>, <i class="parameter"><tt>y</tt></i>). 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" lang="en"><a name="id3452504"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-gtk--item-factory-from-widget"></a><h3>gtk.item_factory_from_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.item_factory_from_widget</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>a <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a>
object</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a>
that created <i class="parameter"><tt>widget</tt></i></td></tr></tbody></table><p>The <tt class="function">gtk.item_factory_from_widget</tt>() function
returns the <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a>
object that created the <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a> specified
by <i class="parameter"><tt>widget</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-gtk--item-factory-path-from-widget"></a><h3>gtk.item_factory_path_from_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.item_factory_path_from_widget</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>a <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a>
object</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the full path to the <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a>
that created <i class="parameter"><tt>widget</tt></i></td></tr></tbody></table><p>The <tt class="function">gtk.item_factory_path_from_widget</tt>()
function returns the full path to the <a href="class-gtkitemfactory.html" title="gtk.ItemFactory"><tt class="classname">gtk.ItemFactory</tt></a>
that created the <a href="class-gtkwidget.html" title="gtk.Widget"><tt class="classname">gtk.Widget</tt></a> specified
by <i class="parameter"><tt>widget</tt></i>.</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>
|