forked from AuroraMiddleware/gtk
Add an example UI description.
* gtk/tmpl/gtkuimanager.sgml: Add an example UI description.
This commit is contained in:
parent
7cddc693b0
commit
38ee74b053
@ -1,5 +1,7 @@
|
||||
2003-09-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/tmpl/gtkuimanager.sgml: Add an example UI description.
|
||||
|
||||
* gtk/gtk-sections.txt: Add gtk_ui_manager_ensure_update.
|
||||
|
||||
2003-08-31 Matthias Clasen <maclas@gmx.de>
|
||||
|
@ -12,8 +12,8 @@ action groups.
|
||||
</para>
|
||||
<refsect2 id="XML-UI"><title>UI Definitions</title>
|
||||
<para>
|
||||
The UI definitions are specified in an XML format which is described
|
||||
by the following DTD.
|
||||
The UI definitions are specified in a #GMarkup format which can be
|
||||
roughly described by the following XML DTD.
|
||||
<programlisting>
|
||||
<!ELEMENT ui (menubar|toolbar|popup)* >
|
||||
<!ELEMENT menubar (menuitem|separator|placeholder|menu)* >
|
||||
@ -38,29 +38,77 @@ by the following DTD.
|
||||
action #REQUIRED
|
||||
pos (top|bot) #IMPLIED >
|
||||
</programlisting>
|
||||
There are some additional restrictions beyond those specified in the DTD, e.g.
|
||||
every toolitem must have a toolbar in its anchestry and every menuitem must have
|
||||
a menubar or popup in its anchestry. If a name is not specified, it defaults to
|
||||
the action. If an action is not specified either, the element name is used.
|
||||
There are some additional restrictions beyond those specified in the
|
||||
DTD, e.g. every toolitem must have a toolbar in its anchestry and
|
||||
every menuitem must have a menubar or popup in its anchestry. If a name
|
||||
is not specified, it defaults to the action. If an action is not specified
|
||||
either, the element name is used.
|
||||
</para>
|
||||
<example>
|
||||
<title>A UI definition</title>
|
||||
<programlisting>
|
||||
<ui>
|
||||
<menubar>
|
||||
<menu name="FileMenu" action="FileMenuAction">
|
||||
<menuitem name="New" action="New2Action" />
|
||||
<placeholder name="FileMenuAdditions" />
|
||||
</menu>
|
||||
<menu name="JustifyMenu" action="JustifyMenuAction">
|
||||
<menuitem name="Left" action="justify-left"/>
|
||||
<menuitem name="Centre" action="justify-center"/>
|
||||
<menuitem name="Right" action="justify-right"/>
|
||||
<menuitem name="Fill" action="justify-fill"/>
|
||||
</menu>
|
||||
</menubar>
|
||||
<toolbar action="toolbar1">
|
||||
<placeholder name="JustifyToolItems">
|
||||
<separator/>
|
||||
<toolitem name="Left" action="justify-left"/>
|
||||
<toolitem name="Centre" action="justify-center"/>
|
||||
<toolitem name="Right" action="justify-right"/>
|
||||
<toolitem name="Fill" action="justify-fill"/>
|
||||
<separator/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
</ui>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
The constructed widget hierarchy is very similar to the element tree
|
||||
of the XML, with the exception that placeholders are merged into their
|
||||
parents. The correspondence of XML elements to widgets should be
|
||||
almost obvious:
|
||||
<variablelist>
|
||||
<varlistentry><term>menubar</term>
|
||||
<listitem><para>a #GtkMenuBar</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry><term>toolbar</term>
|
||||
<listitem><para>a #GtkToolbar</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry><term>popup</term>
|
||||
<listitem><para>a toplevel #GtkMenu</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry><term>menu</term>
|
||||
<listitem><para>a #GtkMenu attached to a menuitem</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry><term>menuitem</term>
|
||||
<listitem><para>a #GtkMenuItem subclass, the exact type depends on the
|
||||
action</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry><term>toolitem</term>
|
||||
<listitem><para>a #GtkToolItem subclass, the exact type depends on the
|
||||
action</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry><term>separator</term>
|
||||
<listitem><para>a #GtkSeparatorMenuItem or
|
||||
#GtkSeparatorToolItem</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
The constructed widget hierarchy is very similar to the element
|
||||
tree of the XML, with the exception that placeholders are merged into their
|
||||
parents. The correspondence of XML elements to widgets should be almost obvious:
|
||||
<itemizedlist>
|
||||
<listitem><para>menubar: a #GtkMenuBar</para></listitem>
|
||||
<listitem><para>toolbar: a #GtkToolBar</para></listitem>
|
||||
<listitem><para>popup: a toplevel #GtkMenu</para></listitem>
|
||||
<listitem><para>menu: a #GtkMenu attached to a menuitem</para></listitem>
|
||||
<listitem><para>menuitem: a #GtkMenuItem subclass, the exact type depends on the action</para></listitem>
|
||||
<listitem><para>toolitem: a #GtkToolItem subclass, the exact type depends on the action</para></listitem>
|
||||
<listitem><para>separator: a #GtkSeparatorMenuItem or #GtkSeparatorToolItem</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
The pos attribute determines where a constructed widget is positioned wrt. to its
|
||||
siblings in the partially constructed tree. If it is "top", the widget is prepended,
|
||||
otherwise it is appended.
|
||||
The pos attribute determines where a constructed widget is positioned
|
||||
wrt. to its siblings in the partially constructed tree. If it is
|
||||
"top", the widget is prepended, otherwise it is appended.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
@ -199,6 +247,14 @@ otherwise it is appended.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_ui_manager_ensure_update ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@self:
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkUIManager::add-widget ##### -->
|
||||
<para>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user