gtkUIManagerNew()
gtkUIManagerSetAddTearoffs(object, add.tearoffs)
gtkUIManagerGetAddTearoffs(object)
gtkUIManagerInsertActionGroup(object, action.group, pos)
gtkUIManagerRemoveActionGroup(object, action.group)
gtkUIManagerGetActionGroups(object)
gtkUIManagerGetAccelGroup(object)
gtkUIManagerGetWidget(object, path)
gtkUIManagerGetToplevels(object, types)
gtkUIManagerGetAction(object, path)
gtkUIManagerAddUiFromString(object, buffer, length = -1, .errwarn = TRUE)
gtkUIManagerNewMergeId(object)
gtkUIManagerAddUi(object, merge.id, path, name, action = NULL, type, top)
gtkUIManagerRemoveUi(object, merge.id)
gtkUIManagerGetUi(object)
gtkUIManagerEnsureUpdate(object)
gtkUIManager()
GObject +----GtkUIManager
GtkBuildable
.GtkUIManager
constructs a user interface (menus and toolbars) from
one or more UI definitions, which reference actions from one or more
action groups.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. Since a
GMarkup
parser is used to parse the UI description, it must not only
be valid XML, but valid GMarkup
. If a name is not specified, it defaults to the action. If an action is
not specified either, the element name is used. The name and action
attributes must not contain '/' characters after parsing (since that
would mess up path lookup) and must be usable as XML attributes when
enclosed in doublequotes, thus they must not '"' characters or references
to the " entity. A UI definitionThe 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:
GtkMenuBar
GtkToolbar
GtkMenu
GtkMenu
attached to a menuitemGtkMenuItem
subclass, the exact type depends on the
actionGtkToolItem
subclass, the exact type depends on the
action. Note that toolitem elements may contain a menu element, but only
if their associated action specifies a GtkMenuToolButton
as proxy.GtkSeparatorMenuItem
or
GtkSeparatorToolItem
GtkUIManager
is that it can overlay a set
of menuitems and toolitems over another one, and demerge them later. Merging is done based on the names of the XML elements. Each element is
identified by a path which consists of the names of its anchestors, separated
by slashes. For example, the menuitem named "Left" in the example above
has the path /ui/menubar/JustifyMenu/Left
and the
toolitem with the same name has path
/ui/toolbar1/JustifyToolItems/Left
.GtkUIManager
are "smart", i.e. they do not show up
in the UI unless they end up between two visible menu or tool items. Separators
which are located at the very beginning or end of the menu or toolbar
containing them, or multiple separators next to each other, are hidden. This
is a useful feature, since the merging of UI elements from multiple sources
can make it hard or impossible to determine in advance whether a separator
will end up in such an unfortunate position. For separators in toolbars, you can set expand="true"
to
turn them from a small, visible separator to an expanding, invisible one.
Toolitems following an expanding separator are effectively right-aligned.GtkUIManager
offers two ways to treat empty submenus:
gtkUIManager
is the equivalent of gtkUIManagerNew
.actions-changed(merge, user.data)
merge
GtkUIManager
user.data
add-widget(merge, widget, user.data)
gtkUIManagerGetWidget
.
Since 2.4 merge
GtkUIManager
widget
user.data
connect-proxy(uimanager, action, proxy, user.data)
uimanager
action
proxy
user.data
disconnect-proxy(uimanager, action, proxy, user.data)
uimanager
action
proxy
user.data
post-activate(uimanager, action, user.data)
action
is activated. This is intended for applications to get notification
just after any action is activated.
Since 2.4 uimanager
action
user.data
pre-activate(uimanager, action, user.data)
action
is activated. This is intended for applications to get notification
just before any action is activated.
Since 2.4 uimanager
action
user.data
add-tearoffs
[logical : Read / Write]ui
[character : * : Read]GtkBuilder