Superclass: g-object
Actions are organised into groups. An action group is essentially a map from names to action objects.
All actions that would make sense to use in a particular context should be in a single group. Multiple action groups may be used for a particular user interface. In fact, it is expected that most nontrivial applications will make use of multiple groups. For example, in an application that can edit multiple documents, one group holding global actions (e.g. quit, about, new), and one group per document holding actions that act on that document (eg. save, cut/copy/paste, etc). Each window's menus would be constructed from a combination of two action groups.
Accelerators are handled by the GTK+ accelerator map. All actions are assigned an accelerator path (which normally has the form <Actions>/group-name/action-name
) and a shortcut is associated with this accelerator path. All menuitems and toolitems take on this accelerator path. The GTK+ accelerator map code makes sure that the correct shortcut is displayed next to the menu item.
Slots:
string
. Accessor: action-group-name
.
A name for the action group.
Default value: NIL
boolean
. Accessor: action-group-sensitive
.
Whether the action group is enabled.
Default value: TRUE
(function (string) string)
. Accessor: action-group-translate-function
. Write-only.
Sets a function to be used for translating the label and tooltip of GtkActionGroupEntrys added by gtk_action_group_add_actions().
If you're using gettext, it is enough to set the action-group-translation-domain.
string
. Accessor: action-group-translation-domain
. Write-only.
Sets the translation domain and uses g_dgettext() for translating the label and tooltip of GtkActionEntrys added by gtk_action_group_add_actions().
boolean
. Accessor: action-group-visible
.
Whether the action group is visible.
Default value: TRUE
Signals:
The connect-proxy
signal is emitted after connecting a proxy to an action in the group. Note that the proxy may have been connected to a different action before.
This is intended for simple customizations for which a custom action class would be too clumsy, e.g. showing tooltips for menuitems in the statusbar.
ui-manager proxies the signal and provides global notification just before any action is connected to a proxy, which is probably more convenient to use.
The disconnect-proxy
signal is emitted after disconnecting a proxy from an action in the group.
ui-manager proxies the signal and provides global notification just before any action is connected to a proxy, which is probably more convenient to use.
The post-activate
signal is emitted just after the action in the action_group is activated
This is intended for ui-manager to proxy the signal and provide global notification just after any action is activated.
The pre-activate
signal is emitted just before the action in the action_group is activated
This is intended for ui-manager to proxy the signal and provide global notification just before any action is activated.