| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.UIManager</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><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-gtktreeviewcolumn.html" title="gtk.TreeViewColumn"><link rel="next" href="class-gtkvbox.html" title="gtk.VBox"></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.UIManager</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktreeviewcolumn.html">Prev</a>Â </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right">Â <a accesskey="n" href="class-gtkvbox.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkuimanager"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.UIManager</h2><p>gtk.UIManager â construct menus and toolbars from an XML |
|---|
| 2 | description (new in PyGTK 2.4)</p></div><div class="refsect1" lang="en"><a name="id3542086"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.UIManager</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>): |
|---|
| 3 | <code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkuimanager.html#constructor-gtkuimanager" title="Constructor">gtk.UIManager</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--set-add-tearoffs" title="gtk.UIManager.set_add_tearoffs">set_add_tearoffs</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>add_tearoffs</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--get-add-tearoffs" title="gtk.UIManager.get_add_tearoffs">get_add_tearoffs</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--insert-action-group" title="gtk.UIManager.insert_action_group">insert_action_group</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action_group</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>pos</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--remove-action-group" title="gtk.UIManager.remove_action_group">remove_action_group</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action_group</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--get-action-groups" title="gtk.UIManager.get_action_groups">get_action_groups</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--get-accel-group" title="gtk.UIManager.get_accel_group">get_accel_group</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--get-widget" title="gtk.UIManager.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 href="class-gtkuimanager.html#method-gtkuimanager--get-toplevels" title="gtk.UIManager.get_toplevels">get_toplevels</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>types</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--get-action" title="gtk.UIManager.get_action">get_action</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 href="class-gtkuimanager.html#method-gtkuimanager--add-ui-from-string" title="gtk.UIManager.add_ui_from_string">add_ui_from_string</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buffer</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--add-ui-from-file" title="gtk.UIManager.add_ui_from_file">add_ui_from_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--add-ui" title="gtk.UIManager.add_ui">add_ui</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>merge_id</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>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>top</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--remove-ui" title="gtk.UIManager.remove_ui">remove_ui</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>merge_id</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--get-ui" title="gtk.UIManager.get_ui">get_ui</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--ensure-update" title="gtk.UIManager.ensure_update">ensure_update</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkuimanager.html#method-gtkuimanager--new-merge-id" title="gtk.UIManager.new_merge_id">new_merge_id</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3542617"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK> |
|---|
| 4 | +-- <a href="class-gtkuimanager.html" title="gtk.UIManager">gtk.UIManager</a> |
|---|
| 5 | </pre></div><div class="refsect1" lang="en"><a name="properties-gtkuimanager"></a><h2>gtk.UIManager Properties</h2><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">"add-tearoffs"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, regular menus have tearoff |
|---|
| 6 | menu items. Note that this only affects regular menus. Generated popup menus |
|---|
| 7 | never have tearoff menu items. Available in <code class="literal">GTK+</code> 2.4 and |
|---|
| 8 | above.</td></tr><tr valign="top"><td valign="top">"ui"</td><td valign="top">Read-Write</td><td valign="top">An XML string describing the merged UI.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkuimanager"></a><h2>gtk.UIManager Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkuimanager.html#signal-gtkuimanager--actions-changed" title='The "actions-changed" gtk.UIManager Signal'>actions-changed</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</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><span class="term">"<a href="class-gtkuimanager.html#signal-gtkuimanager--add-widget" title='The "add-widget" gtk.UIManager Signal'>add-widget</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>widget</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><span class="term">"<a href="class-gtkuimanager.html#signal-gtkuimanager--connect-proxy" title='The "connect-proxy" gtk.UIManager Signal'>connect-proxy</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>widget</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><span class="term">"<a href="class-gtkuimanager.html#signal-gtkuimanager--disconnect-proxy" title='The "disconnect-proxy" gtk.UIManager Signal'>disconnect-proxy</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>widget</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><span class="term">"<a href="class-gtkuimanager.html#signal-gtkuimanager--post-activate" title='The "post-activate" gtk.UIManager Signal'>post-activate</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</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><span class="term">"<a href="class-gtkuimanager.html#signal-gtkuimanager--pre-activate" title='The "pre-activate" gtk.UIManager Signal'>pre-activate</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</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="id3543223"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This object is available in PyGTK 2.4 and above.</p></div><p>A <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> |
|---|
| 9 | constructs a user interface (menus and toolbars) from one or more UI |
|---|
| 10 | definitions, which reference actions from one or more action groups.</p><div class="refsect2" lang="en"><a name="XML-UI"></a><h3>UI Definitions</h3><p>The UI definitions are specified in an XML format which can be |
|---|
| 11 | roughly described by the following DTD.</p><pre class="programlisting"> |
|---|
| 12 | <!ELEMENT ui (menubar|toolbar|popup|accelerator)* > |
|---|
| 13 | <!ELEMENT menubar (menuitem|separator|placeholder|menu)* > |
|---|
| 14 | <!ELEMENT menu (menuitem|separator|placeholder|menu)* > |
|---|
| 15 | <!ELEMENT popup (menuitem|separator|placeholder|menu)* > |
|---|
| 16 | <!ELEMENT toolbar (toolitem|separator|placeholder)* > |
|---|
| 17 | <!ELEMENT placeholder (menuitem|toolitem|separator|placeholder|menu)* > |
|---|
| 18 | <!ELEMENT menuitem EMPTY > |
|---|
| 19 | <!ELEMENT toolitem EMPTY > |
|---|
| 20 | <!ELEMENT separator EMPTY > |
|---|
| 21 | <!ELEMENT accelerator EMPTY > |
|---|
| 22 | <!ATTLIST menubar name #IMPLIED > |
|---|
| 23 | <!ATTLIST toolbar name #IMPLIED > |
|---|
| 24 | <!ATTLIST popup name #IMPLIED > |
|---|
| 25 | <!ATTLIST placeholder name #IMPLIED > |
|---|
| 26 | <!ATTLIST menu name #IMPLIED |
|---|
| 27 | action #REQUIRED |
|---|
| 28 | position (top|bot) #IMPLIED > |
|---|
| 29 | <!ATTLIST menuitem name #IMPLIED |
|---|
| 30 | action #REQUIRED |
|---|
| 31 | position (top|bot) #IMPLIED > |
|---|
| 32 | <!ATTLIST toolitem name #IMPLIED |
|---|
| 33 | action #REQUIRED |
|---|
| 34 | position (top|bot) #IMPLIED > |
|---|
| 35 | <!ATTLIST accelerator name #IMPLIED |
|---|
| 36 | action #REQUIRED > |
|---|
| 37 | </pre><p>There are some additional restrictions beyond those specified in |
|---|
| 38 | the DTD, e.g. every toolitem must have a toolbar in its ancestry and every |
|---|
| 39 | menuitem must have a menubar or popup in its ancestry. Since a GMarkup |
|---|
| 40 | parser is used to parse the UI description, it must not only be valid XML, |
|---|
| 41 | but valid GMarkup. If a name is not specified, it defaults to the action. If |
|---|
| 42 | an action is not specified either, the element name is used.</p><div class="example"><a name="id3543303"></a><p class="title"><b>Example 5. A UI definition</b></p><pre class="programlisting"> |
|---|
| 43 | <ui> |
|---|
| 44 | <menubar> |
|---|
| 45 | <menu name="FileMenu" action="FileMenuAction"> |
|---|
| 46 | <menuitem name="New" action="New2Action" /> |
|---|
| 47 | <placeholder name="FileMenuAdditions" /> |
|---|
| 48 | </menu> |
|---|
| 49 | <menu name="JustifyMenu" action="JustifyMenuAction"> |
|---|
| 50 | <menuitem name="Left" action="justify-left"/> |
|---|
| 51 | <menuitem name="Centre" action="justify-center"/> |
|---|
| 52 | <menuitem name="Right" action="justify-right"/> |
|---|
| 53 | <menuitem name="Fill" action="justify-fill"/> |
|---|
| 54 | </menu> |
|---|
| 55 | </menubar> |
|---|
| 56 | <toolbar action="toolbar1"> |
|---|
| 57 | <placeholder name="JustifyToolItems"> |
|---|
| 58 | <separator/> |
|---|
| 59 | <toolitem name="Left" action="justify-left"/> |
|---|
| 60 | <toolitem name="Centre" action="justify-center"/> |
|---|
| 61 | <toolitem name="Right" action="justify-right"/> |
|---|
| 62 | <toolitem name="Fill" action="justify-fill"/> |
|---|
| 63 | <separator/> |
|---|
| 64 | </placeholder> |
|---|
| 65 | </toolbar> |
|---|
| 66 | </ui> |
|---|
| 67 | </pre></div><p>The constructed widget hierarchy is very similar to the element |
|---|
| 68 | tree of the XML, with the exception that placeholders are merged into their |
|---|
| 69 | parents. The correspondence of XML elements to widgets should be almost |
|---|
| 70 | obvious:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">menubar</span></td><td>a <a href="class-gtkmenubar.html" title="gtk.MenuBar"><code class="classname">gtk.MenuBar</code></a></td></tr><tr><td><span class="term">toolbar</span></td><td>a <a href="class-gtktoolbar.html" title="gtk.Toolbar"><code class="classname">gtk.Toolbar</code></a></td></tr><tr><td><span class="term">popup</span></td><td>a toplevel <a href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a></td></tr><tr><td><span class="term">menu</span></td><td>a <a href="class-gtkmenu.html" title="gtk.Menu"><code class="classname">gtk.Menu</code></a> |
|---|
| 71 | attached to a menuitem</td></tr><tr><td><span class="term">menuitem</span></td><td>a <a href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> |
|---|
| 72 | subclass, the exact type depends on the action</td></tr><tr><td><span class="term">toolitem</span></td><td>a <a href="class-gtktoolitem.html" title="gtk.ToolItem"><code class="classname">gtk.ToolItem</code></a> |
|---|
| 73 | subclass, the exact type depends on the action</td></tr><tr><td><span class="term">separator</span></td><td>a <a href="class-gtkseparatormenuitem.html" title="gtk.SeparatorMenuItem"><code class="classname">gtk.SeparatorMenuItem</code></a> |
|---|
| 74 | or <a href="class-gtkseparatortoolitem.html" title="gtk.SeparatorToolItem"><code class="classname">gtk.SeparatorToolItem</code></a></td></tr><tr><td><span class="term">accelerator</span></td><td>a keyboard accelerator</td></tr></tbody></table><p>The "position" attribute determines where a constructed widget |
|---|
| 75 | is positioned with respect to its siblings in the partially constructed |
|---|
| 76 | tree. If it is "top", the widget is prepended, otherwise it is |
|---|
| 77 | appended.</p></div><div class="refsect2" lang="en"><a name="id3543525"></a><h3>UI Merging</h3><p>The most remarkable feature of <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> is |
|---|
| 78 | that it can overlay a set of menuitems and toolitems over another one, and |
|---|
| 79 | demerge them later.</p><p>Merging is done based on the name of the XML elements. Each |
|---|
| 80 | element is identified by a path which consists of the names of its |
|---|
| 81 | ancestors, separated by slashes. For example, the menuitem named "Left" in |
|---|
| 82 | the example above has the path |
|---|
| 83 | <code class="filename">/ui/menubar/JustifyMenu/Left</code> and the toolitem with the |
|---|
| 84 | same name has path |
|---|
| 85 | <code class="filename">/ui/toolbar1/JustifyToolItems/Left</code>.</p></div><div class="refsect2" lang="en"><a name="id3543567"></a><h3>Accelerators</h3><p>Every action has an accelerator path. Accelerators are installed |
|---|
| 86 | together with menuitem proxies, but they can also be explicitly added with |
|---|
| 87 | <accelerator> elements in the UI definition. This makes it possible to |
|---|
| 88 | have accelerators for actions even if they have no visible proxies.</p></div><div class="refsect2" lang="en"><a name="id3543583"></a><h3>Smart Separators</h3><p>The separators created by <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> are |
|---|
| 89 | "smart", i.e. they do not show up in the UI unless they end up between two |
|---|
| 90 | visible menu or tool items. Separators which are located at the very |
|---|
| 91 | beginning or end of the menu or toolbar containing them, or multiple |
|---|
| 92 | separators next to each other, are hidden. This is a useful feature, since |
|---|
| 93 | the merging of UI elements from multiple sources can make it hard or |
|---|
| 94 | impossible to determine in advance whether a separator will end up in such |
|---|
| 95 | an unfortunate position.</p></div><div class="refsect2" lang="en"><a name="id3543609"></a><h3>Empty Menus</h3><p>Submenus pose similar problems to separators in connection with |
|---|
| 96 | merging. It is impossible to know in advance whether they will end up empty |
|---|
| 97 | after merging. <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> |
|---|
| 98 | offers two ways to treat empty submenus:</p><div class="itemizedlist"><ul type="disc"><li>make them disappear by hiding the menu item they're |
|---|
| 99 | attached to</li><li>add an insensitive "Empty" item</li></ul></div><p>The behavior is chosen based on the "is_important" property of |
|---|
| 100 | the action to which the submenu is associated.</p></div></div><div class="refsect1" lang="en"><a name="constructor-gtkuimanager"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.UIManager</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>a new ui manager object.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> |
|---|
| 101 | object.</p></div><div class="refsect1" lang="en"><a name="id3543727"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkuimanager--set-add-tearoffs"></a><h3>gtk.UIManager.set_add_tearoffs</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_add_tearoffs</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>add_tearoffs</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>add_tearoffs</code></strong>Â :</span></td><td><code class="literal">True</code> if tearoff menu items |
|---|
| 102 | are added to regular menus</td></tr></tbody></table><div class="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">add_tearoffs</code>() method sets the |
|---|
| 103 | "add_tearoffs" property to the value of |
|---|
| 104 | <em class="parameter"><code>add_tearoffs</code></em>. If <em class="parameter"><code>add_tearoffs</code></em> |
|---|
| 105 | is <code class="literal">True</code> regular menus generated by this <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> |
|---|
| 106 | will have tearoff menu items.</p><p>Note that this only affects regular menus. Generated popup menus |
|---|
| 107 | never have tearoff menu items.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-add-tearoffs"></a><h3>gtk.UIManager.get_add_tearoffs</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_add_tearoffs</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td><code class="literal">True</code> if tearoff menu items |
|---|
| 108 | are added</td></tr></tbody></table><div class="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">get_add_tearoffs</code>() method returns |
|---|
| 109 | the value of the "add-tearoffs" property. If "add-tearoffs" is |
|---|
| 110 | <code class="literal">True</code> regular menus generated will have tearoff menu |
|---|
| 111 | items.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--insert-action-group"></a><h3>gtk.UIManager.insert_action_group</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_action_group</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action_group</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>pos</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>action_group</code></strong>Â :</span></td><td>the action group to be |
|---|
| 112 | inserted</td></tr><tr><td><span class="term"><strong class="parameter"><code>pos</code></strong>Â :</span></td><td>the position at which the group will be |
|---|
| 113 | inserted. If <em class="parameter"><code>pos</code></em> is negative |
|---|
| 114 | <em class="parameter"><code>action_group</code></em> is inserted at the end of the |
|---|
| 115 | list.</td></tr></tbody></table><div class="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">insert_action_group</code>() method |
|---|
| 116 | inserts the <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a> |
|---|
| 117 | specified by <em class="parameter"><code>action_group</code></em> into the list of associated |
|---|
| 118 | action groups at the position specified by |
|---|
| 119 | <em class="parameter"><code>pos</code></em>. Actions in earlier groups hide actions with the |
|---|
| 120 | same name in later groups.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--remove-action-group"></a><h3>gtk.UIManager.remove_action_group</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_action_group</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action_group</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>action_group</code></strong>Â :</span></td><td>the action group to be |
|---|
| 121 | removed</td></tr></tbody></table><div class="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">remove_action_group</code>() method |
|---|
| 122 | removes the <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a> |
|---|
| 123 | specified by <em class="parameter"><code>action_group</code></em> from the list of |
|---|
| 124 | associated action groups.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-action-groups"></a><h3>gtk.UIManager.get_action_groups</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_action_groups</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>a list of associated action |
|---|
| 125 | groups.</td></tr></tbody></table><div class="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">get_action_groups</code>() method returns |
|---|
| 126 | the list of associated <a href="class-gtkactiongroup.html" title="gtk.ActionGroup"><code class="classname">gtk.ActionGroup</code></a> |
|---|
| 127 | objects.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-accel-group"></a><h3>gtk.UIManager.get_accel_group</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_accel_group</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>the <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>.</td></tr></tbody></table><div class="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">get_accel_group</code>() method returns |
|---|
| 128 | the associated <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-widget"></a><h3>gtk.UIManager.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><span class="term"><strong class="parameter"><code>path</code></strong>Â :</span></td><td>a path</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>the widget found by following the path, or |
|---|
| 129 | <code class="literal">None</code> if no widget was |
|---|
| 130 | found.</td></tr></tbody></table><div class="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">get_widget</code>() method looks up a |
|---|
| 131 | widget by following the path specified by <em class="parameter"><code>path</code></em>. The |
|---|
| 132 | path consists of the names specified in the XML description of the UI. |
|---|
| 133 | separated by '/'. Elements that don't have a name or action attribute in |
|---|
| 134 | the XML (e.g. <popup>) can be addressed by their XML element name |
|---|
| 135 | (e.g. "popup"). The root element ("/ui") can be omitted in the path.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-toplevels"></a><h3>gtk.UIManager.get_toplevels</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_toplevels</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>types</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>types</code></strong>Â :</span></td><td>specifies the types of toplevel widgets to |
|---|
| 136 | include. Allowed types are |
|---|
| 137 | <code class="literal">gtk.UI_MANAGER_MENUBAR</code>, |
|---|
| 138 | <code class="literal">gtk.UI_MANAGER_TOOLBAR</code> and |
|---|
| 139 | <code class="literal">gtk.UI_MANAGER_POPUP</code>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>a list of all toplevel widgets of the requested |
|---|
| 140 | types.</td></tr></tbody></table><div class="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">get_toplevels</code>() method returns a |
|---|
| 141 | list of all toplevel widgets of the types specified by |
|---|
| 142 | <em class="parameter"><code>types</code></em>.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-action"></a><h3>gtk.UIManager.get_action</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_action</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><span class="term"><strong class="parameter"><code>path</code></strong>Â :</span></td><td>a path</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>the action whose proxy widget is found by |
|---|
| 143 | following the path, or <code class="literal">None</code> if no widget was |
|---|
| 144 | found.</td></tr></tbody></table><div class="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">get_action</code>() method looks up a |
|---|
| 145 | <a href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> by |
|---|
| 146 | following a path. See the <a href="class-gtkuimanager.html#method-gtkuimanager--get-widget" title="gtk.UIManager.get_widget"><code class="methodname">get_widget()</code></a> |
|---|
| 147 | method for more information about paths.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--add-ui-from-string"></a><h3>gtk.UIManager.add_ui_from_string</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_ui_from_string</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buffer</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>buffer</code></strong>Â :</span></td><td>the string to parse</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>The merge id for the merged UI. The merge id |
|---|
| 148 | can be used to unmerge the UI with the <a href="class-gtkuimanager.html#method-gtkuimanager--remove-ui" title="gtk.UIManager.remove_ui"><code class="methodname">remove_ui()</code></a> |
|---|
| 149 | method.</td></tr></tbody></table><div class="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">add_ui_from_string</code>() method parses |
|---|
| 150 | the string specified by <em class="parameter"><code>buffer</code></em> that contains a <a href="class-gtkuimanager.html#XML-UI" title="UI Definitions">UI definition</a> and merges it with the current |
|---|
| 151 | contents of the ui manager. An enclosing <ui> element is added if it |
|---|
| 152 | is missing.</p><p>This method raise the GError exception if an error occurs during |
|---|
| 153 | the parsing of the string.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--add-ui-from-file"></a><h3>gtk.UIManager.add_ui_from_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_ui_from_file</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>filename</code></strong>Â :</span></td><td>the name of the file to parse</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>The merge id for the merged UI. The merge id |
|---|
| 154 | can be used to unmerge the UI with the <a href="class-gtkuimanager.html#method-gtkuimanager--remove-ui" title="gtk.UIManager.remove_ui"><code class="methodname">gtk.UIManager.remove_ui()</code></a> |
|---|
| 155 | method.</td></tr></tbody></table><div class="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">add_ui_from_file</code>() method parses |
|---|
| 156 | the file specified by <em class="parameter"><code>filename</code></em> that contains a <a href="class-gtkuimanager.html#XML-UI" title="UI Definitions">UI definition</a> and merges it with the current |
|---|
| 157 | contents of the ui manager.</p><p>This method raise the GError exception if an error occurs during |
|---|
| 158 | the parsing of the file.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--add-ui"></a><h3>gtk.UIManager.add_ui</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_ui</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>merge_id</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>name</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>top</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>merge_id</code></strong>Â :</span></td><td>the merge id for the merged UI, see <a href="class-gtkuimanager.html#method-gtkuimanager--new-merge-id" title="gtk.UIManager.new_merge_id"><code class="methodname">new_merge_id()</code></a></td></tr><tr><td><span class="term"><strong class="parameter"><code>path</code></strong>Â :</span></td><td>a path where the element should be |
|---|
| 159 | added</td></tr><tr><td><span class="term"><strong class="parameter"><code>name</code></strong>Â :</span></td><td>the name for the added UI |
|---|
| 160 | element</td></tr><tr><td><span class="term"><strong class="parameter"><code>action</code></strong>Â :</span></td><td>the name of the action to be proxied, or |
|---|
| 161 | <code class="literal">None</code> to add a separator</td></tr><tr><td><span class="term"><strong class="parameter"><code>type</code></strong>Â :</span></td><td>the type of UI element to |
|---|
| 162 | add.</td></tr><tr><td><span class="term"><strong class="parameter"><code>top</code></strong>Â :</span></td><td>if <code class="literal">True</code>, the UI element is |
|---|
| 163 | added before its siblings, otherwise it is added after its |
|---|
| 164 | siblings.</td></tr></tbody></table><div class="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">add_ui</code>() method adds a UI element |
|---|
| 165 | of the type specified by <em class="parameter"><code>type</code></em> to the current contents |
|---|
| 166 | of the ui manager at the location specified by |
|---|
| 167 | <em class="parameter"><code>path</code></em>. Note that path must not start with "/ui" though |
|---|
| 168 | "ui" is acceptable. For example "/menubar" or "ui/menubar" is acceptable but |
|---|
| 169 | "/ui/menubar" is not. <em class="parameter"><code>type</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_AUTO</code></span></td><td>The type of the UI element (menuitem, toolitem or |
|---|
| 170 | separator) is set according to the context.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_MENUBAR</code></span></td><td>A menubar. </td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_MENU</code></span></td><td>A menu.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_TOOLBAR</code></span></td><td>A toolbar.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_PLACEHOLDER</code></span></td><td>A placeholder.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_POPUP</code></span></td><td>A popup menu.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_MENUITEM</code></span></td><td>A menuitem.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_TOOLITEM</code></span></td><td>A toolitem.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_SEPARATOR</code></span></td><td>A separator.</td></tr><tr><td><span class="term"><code class="literal">gtk.UI_MANAGER_ACCELERATOR</code></span></td><td>An accelerator.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--remove-ui"></a><h3>gtk.UIManager.remove_ui</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_ui</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>merge_id</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>merge_id</code></strong>Â :</span></td><td>a merge id</td></tr></tbody></table><div class="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">remove_ui</code>() method unmerges the |
|---|
| 171 | part of the ui manager content identified by |
|---|
| 172 | <em class="parameter"><code>merge_id</code></em>.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--get-ui"></a><h3>gtk.UIManager.get_ui</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_ui</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>A string containing an XML representation of |
|---|
| 173 | the merged UI.</td></tr></tbody></table><div class="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">get_ui</code>() method creates a <a href="class-gtkuimanager.html#XML-UI" title="UI Definitions">UI definition</a> of the merged UI.</p></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--ensure-update"></a><h3>gtk.UIManager.ensure_update</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">ensure_update</span>(<span class="methodparam"></span>)</code></pre><div class="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">ensure_update</code>() method makes sure |
|---|
| 174 | that all pending updates to the UI have been completed. This may |
|---|
| 175 | occasionally be necessary, since <a href="class-gtkuimanager.html" title="gtk.UIManager"><code class="classname">gtk.UIManager</code></a> |
|---|
| 176 | updates the UI in an idle function. A typical example where this method is |
|---|
| 177 | useful is to enforce that the menubar and toolbar have been added to the |
|---|
| 178 | main window before showing it:</p><div class="informalexample"><pre class="programlisting"> |
|---|
| 179 | window.add(vbox) |
|---|
| 180 | merge.connect("add_widget", add_widget, vbox) |
|---|
| 181 | merge.add_ui_from_file("my-menus") |
|---|
| 182 | merge.add_ui_from_file("my-toolbars") |
|---|
| 183 | merge.ensure_update() |
|---|
| 184 | window.show() |
|---|
| 185 | </pre></div></div><div class="refsect2" lang="en"><a name="method-gtkuimanager--new-merge-id"></a><h3>gtk.UIManager.new_merge_id</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">new_merge_id</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>an unused merge id.</td></tr></tbody></table><div class="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">new_merge_id</code>() method returns an |
|---|
| 186 | unused merge id, suitable for use with the <a href="class-gtkuimanager.html#method-gtkuimanager--add-ui" title="gtk.UIManager.add_ui"><code class="methodname">add_ui()</code></a> |
|---|
| 187 | method. The returned merge ids are monotonically increasing integer |
|---|
| 188 | values.</p></div></div><div class="refsect1" lang="en"><a name="id3545706"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkuimanager--actions-changed"></a><h3>The "actions-changed" gtk.UIManager Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</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><span class="term"><em class="parameter"><code>uimanager</code></em>Â :</span></td><td>the uimanager that received the |
|---|
| 189 | signal</td></tr><tr><td><span class="term"><em class="parameter"><code>user_param1</code></em>Â :</span></td><td>the first user parameter (if any) specified |
|---|
| 190 | with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK> |
|---|
| 191 | method</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em>Â :</span></td><td>additional user parameters (if |
|---|
| 192 | any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "actions-changed" signal is emitted when the set of actions |
|---|
| 193 | changes.</p></div><div class="refsect2" lang="en"><a name="signal-gtkuimanager--add-widget"></a><h3>The "add-widget" gtk.UIManager Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>widget</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><span class="term"><em class="parameter"><code>uimanager</code></em>Â :</span></td><td>the uimanager that received the |
|---|
| 194 | signal</td></tr><tr><td><span class="term"><em class="parameter"><code>widget</code></em>Â :</span></td><td>the added widget</td></tr><tr><td><span class="term"><em class="parameter"><code>user_param1</code></em>Â :</span></td><td>the first user parameter (if any) specified |
|---|
| 195 | with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK> |
|---|
| 196 | method</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em>Â :</span></td><td>additional user parameters (if |
|---|
| 197 | any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "add-widget" signal is emitted for each generated menubar |
|---|
| 198 | and toolbar. The added widget is specified by |
|---|
| 199 | <em class="parameter"><code>widget</code></em>. It is not emitted for generated popup menus, |
|---|
| 200 | which can be retrieved by the <a href="class-gtkuimanager.html#method-gtkuimanager--get-widget" title="gtk.UIManager.get_widget"><code class="methodname">get_widget</code>()</a> |
|---|
| 201 | method.</p></div><div class="refsect2" lang="en"><a name="signal-gtkuimanager--connect-proxy"></a><h3>The "connect-proxy" gtk.UIManager Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>widget</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><span class="term"><em class="parameter"><code>uimanager</code></em>Â :</span></td><td>the uimanager that received the |
|---|
| 202 | signal</td></tr><tr><td><span class="term"><em class="parameter"><code>action</code></em>Â :</span></td><td>the action</td></tr><tr><td><span class="term"><em class="parameter"><code>widget</code></em>Â :</span></td><td>the proxy widget</td></tr><tr><td><span class="term"><em class="parameter"><code>user_param1</code></em>Â :</span></td><td>the first user parameter (if any) specified |
|---|
| 203 | with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK> |
|---|
| 204 | method</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em>Â :</span></td><td>additional user parameters (if |
|---|
| 205 | any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "connect-proxy" signal is emitted after connecting the proxy |
|---|
| 206 | widget specified by <em class="parameter"><code>widget</code></em> to the <a href="class-gtkaction.html" title="gtk.Action"><code class="classname">gtk.Action</code></a> specified |
|---|
| 207 | by <em class="parameter"><code>action</code></em> in the group. This is intended for simple |
|---|
| 208 | customizations for which a custom action class would be too clumsy, |
|---|
| 209 | e.g. showing tooltips for menuitems in the statusbar.</p></div><div class="refsect2" lang="en"><a name="signal-gtkuimanager--disconnect-proxy"></a><h3>The "disconnect-proxy" gtk.UIManager Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>widget</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><span class="term"><em class="parameter"><code>uimanager</code></em>Â :</span></td><td>the uimanager that received the |
|---|
| 210 | signal</td></tr><tr><td><span class="term"><em class="parameter"><code>action</code></em>Â :</span></td><td>the action</td></tr><tr><td><span class="term"><em class="parameter"><code>widget</code></em>Â :</span></td><td>the proxy widget</td></tr><tr><td><span class="term"><em class="parameter"><code>user_param1</code></em>Â :</span></td><td>the first user parameter (if any) specified |
|---|
| 211 | with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK> |
|---|
| 212 | method</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em>Â :</span></td><td>additional user parameters (if |
|---|
| 213 | any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "disconnect-proxy" signal is emitted when |
|---|
| 214 | <em class="parameter"><code>widget</code></em> is disconnected from |
|---|
| 215 | <em class="parameter"><code>action</code></em>.</p></div><div class="refsect2" lang="en"><a name="signal-gtkuimanager--post-activate"></a><h3>The "post-activate" gtk.UIManager Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</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><span class="term"><em class="parameter"><code>uimanager</code></em>Â :</span></td><td>the uimanager that received the |
|---|
| 216 | signal</td></tr><tr><td><span class="term"><em class="parameter"><code>action</code></em>Â :</span></td><td>the action</td></tr><tr><td><span class="term"><em class="parameter"><code>user_param1</code></em>Â :</span></td><td>the first user parameter (if any) specified |
|---|
| 217 | with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK> |
|---|
| 218 | method</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em>Â :</span></td><td>additional user parameters (if |
|---|
| 219 | any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "post-activate" signal is emitted after |
|---|
| 220 | <em class="parameter"><code>action</code></em> is activated. This signal is intended for |
|---|
| 221 | applications to get notification after any action is activated.</p></div><div class="refsect2" lang="en"><a name="signal-gtkuimanager--pre-activate"></a><h3>The "pre-activate" gtk.UIManager Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>uimanager</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>action</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><span class="term"><em class="parameter"><code>uimanager</code></em>Â :</span></td><td>the uimanager that received the |
|---|
| 222 | signal</td></tr><tr><td><span class="term"><em class="parameter"><code>action</code></em>Â :</span></td><td>the action</td></tr><tr><td><span class="term"><em class="parameter"><code>user_param1</code></em>Â :</span></td><td>the first user parameter (if any) specified |
|---|
| 223 | with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK> |
|---|
| 224 | method</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em>Â :</span></td><td>additional user parameters (if |
|---|
| 225 | any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "pre-activate" signal is emitted before |
|---|
| 226 | <em class="parameter"><code>action</code></em> is activated. This signal is intended for |
|---|
| 227 | applications to get notification before any action is activated.</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-gtktreeviewcolumn.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-gtkvbox.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.TreeViewColumn </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.VBox</td></tr></table></div></body></html> |
|---|