1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 constructing menus and toolbars from an XML description
7 <!-- ##### SECTION Long_Description ##### -->
9 A #GtkUIManager constructs a user interface (menus and toolbars) from
10 one or more UI definitions, which reference actions from one or ore
13 <refsect2 id="XML-UI"><title>UI Definitions</title>
15 The UI definitions are specified in an XML format which is described
18 <!ELEMENT ui (menubar|toolbar|popup)* >
19 <!ELEMENT menubar (menuitem|separator|placeholder|menu)* >
20 <!ELEMENT menu (menuitem|separator|placeholder|menu)* >
21 <!ELEMENT popup (menuitem|separator|placeholder|menu)* >
22 <!ELEMENT toolbar (toolitem|separator|placeholder)* >
23 <!ELEMENT placeholder (menuitem|toolitem|separator|placeholder|menu)* >
24 <!ELEMENT menuitem EMPTY >
25 <!ELEMENT toolitem EMPTY >
26 <!ELEMENT separator EMPTY >
27 <!ATTLIST menubar name #IMPLIED >
28 <!ATTLIST toolbar name #IMPLIED >
29 <!ATTLIST popup name #IMPLIED >
30 <!ATTLIST placeholder name #IMPLIED >
31 <!ATTLIST menu name #IMPLIED
33 pos (top|bot) #IMPLIED >
34 <!ATTLIST menuitem name #IMPLIED
36 pos (top|bot) #IMPLIED >
37 <!ATTLIST toolitem name #IMPLIED
39 pos (top|bot) #IMPLIED >
41 There are some additional restrictions beyond those specified in the DTD, e.g.
42 every toolitem must have a toolbar in its anchestry and every menuitem must have
43 a menubar or popup in its anchestry. If a name is not specified, it defaults to
44 the action. If an action is not specified either, the element name is used.
47 The constructed widget hierarchy is very similar to the element
48 tree of the XML, with the exception that placeholders are merged into their
49 parents. The correspondence of XML elements to widgets should be almost obvious:
51 <listitem><para>menubar: a #GtkMenuBar</para></listitem>
52 <listitem><para>toolbar: a #GtkToolBar</para></listitem>
53 <listitem><para>popup: a toplevel #GtkMenu</para></listitem>
54 <listitem><para>menu: a #GtkMenu attached to a menuitem</para></listitem>
55 <listitem><para>menuitem: a #GtkMenuItem subclass, the exact type depends on the action</para></listitem>
56 <listitem><para>toolitem: a #GtkToolItem subclass, the exact type depends on the action</para></listitem>
57 <listitem><para>separator: a #GtkSeparatorMenuItem or #GtkSeparatorToolItem</para></listitem>
61 The pos attribute determines where a constructed widget is positioned wrt. to its
62 siblings in the partially constructed tree. If it is "top", the widget is prepended,
63 otherwise it is appended.
67 <!-- ##### SECTION See_Also ##### -->
72 <!-- ##### STRUCT GtkUIManager ##### -->
78 <!-- ##### FUNCTION gtk_ui_manager_new ##### -->
86 <!-- ##### FUNCTION gtk_ui_manager_set_add_tearoffs ##### -->
95 <!-- ##### FUNCTION gtk_ui_manager_get_add_tearoffs ##### -->
104 <!-- ##### FUNCTION gtk_ui_manager_insert_action_group ##### -->
114 <!-- ##### FUNCTION gtk_ui_manager_remove_action_group ##### -->
123 <!-- ##### FUNCTION gtk_ui_manager_get_action_groups ##### -->
132 <!-- ##### FUNCTION gtk_ui_manager_get_accel_group ##### -->
141 <!-- ##### FUNCTION gtk_ui_manager_get_widget ##### -->
151 <!-- ##### FUNCTION gtk_ui_manager_get_action ##### -->
161 <!-- ##### FUNCTION gtk_ui_manager_add_ui_from_string ##### -->
173 <!-- ##### FUNCTION gtk_ui_manager_add_ui_from_file ##### -->
184 <!-- ##### FUNCTION gtk_ui_manager_remove_ui ##### -->
193 <!-- ##### FUNCTION gtk_ui_manager_get_ui ##### -->
202 <!-- ##### SIGNAL GtkUIManager::add-widget ##### -->
207 @uimanager: the object which received the signal.
210 <!-- ##### SIGNAL GtkUIManager::changed ##### -->
215 @uimanager: the object which received the signal.
217 <!-- ##### ARG GtkUIManager:add-tearoffs ##### -->