A group of actions
Actions are organised into groups. An action group is essentially a map from
names to <gtk-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>//’) 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.
Derives from
<gtk-buildable>
,<gobject>
.This class defines the following slots:
name
- A name for the action group.
sensitive
- Whether the action group is enabled.
visible
- Whether the action group is visible.
<gtk-action>
) (arg1 <gtk-widget>
)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.
<gtk-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.Since 2.4
<gtk-action>
) (arg1 <gtk-widget>
)The disconnect_proxy signal is emitted after disconnecting a proxy from an action in the group.
<gtk-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.Since 2.4
<gtk-action>
)The pre_activate signal is emitted just before the action in the action-group is activated
This is intended for
<gtk-ui-manager>
to proxy the signal and provide global notification just before any action is activated.Since 2.4
<gtk-action>
)The post_activate signal is emitted just after the action in the action-group is activated
This is intended for
<gtk-ui-manager>
to proxy the signal and provide global notification just after any action is activated.Since 2.4
mchars
) ⇒ (ret <gtk-action-group>
)Creates a new
<gtk-action-group>
object. The name of the action group is used when associating keybindings with the actions.
- name
- the name of the action group.
- ret
- the new
<gtk-action-group>
Since 2.4
<gtk-action-group>
) ⇒ (ret mchars
)Gets the name of the action group.
- action-group
- the action group
- ret
- the name of the action group.
Since 2.4
<gtk-action-group>
) ⇒ (ret bool
)Returns ‘
#t
’ if the group is sensitive. The constituent actions can only be logically sensitive (seegtk-action-is-sensitive
) if they are sensitive (seegtk-action-get-sensitive
) and their group is sensitive.
- action-group
- the action group
- ret
- ‘
#t
’ if the group is sensitive.Since 2.4
<gtk-action-group>
) (sensitive bool
)Changes the sensitivity of action-group
- action-group
- the action group
- sensitive
- new sensitivity
Since 2.4
<gtk-action-group>
) ⇒ (ret bool
)Returns ‘
#t
’ if the group is visible. The constituent actions can only be logically visible (seegtk-action-is-visible
) if they are visible (seegtk-action-get-visible
) and their group is visible.
- action-group
- the action group
- ret
- ‘
#t
’ if the group is visible.Since 2.4
<gtk-action-group>
) (visible bool
)Changes the visible of action-group.
- action-group
- the action group
- visible
- new visiblity
Since 2.4
<gtk-action-group>
) (action_name mchars
) ⇒ (ret <gtk-action>
)Looks up an action in the action group by name.
- action-group
- the action group
- action-name
- the name of the action
- ret
- the action, or ‘
#f
’ if no action by that name existsSince 2.4
<gtk-action-group>
) ⇒ (ret glist-of
)Lists the actions in the action group.
- action-group
- the action group
- ret
- an allocated list of the action objects in the action group
Since 2.4
<gtk-action-group>
) (action <gtk-action>
)Adds an action object to the action group. Note that this function does not set up the accel path of the action, which can lead to problems if a user tries to modify the accelerator of a menuitem associated with the action. Therefore you must either set the accel path yourself with
gtk-action-set-accel-path
, or use ‘gtk_action_group_add_action_with_accel (..., NULL)’.
- action-group
- the action group
- action
- an action
Since 2.4
<gtk-action-group>
) (action <gtk-action>
)Removes an action object from the action group.
- action-group
- the action group
- action
- an action
Since 2.4
<gtk-action-group>
) (entries scm
)This is a convenience function to create a number of actions and add them to the action group.
The "activate" signals of the actions are connected to the callbacks and their accel paths are set to ‘<Actions>//’.
- action-group
- The action group
- scm
- An list of actions. The actions are of the form
(
name stock-idlabel accelerator tooltip proc?)
. All values are strings except the proc, which should be a procedure suitable for connecting to theactivate
signal on the action. stock-id, label, accelerator, tooltip, and proc may be#f
.Since 2.4
<gtk-action-group>
) (entries scm
)This is a convenience function to create a number of toggle actions and add them to the action group.
The "activate" signals of the actions are connected to the callbacks and their accel paths are set to ‘<Actions>/group-name/action-name’.
- action-group
- the action group
- entries
- an array of toggle action descriptions
- n-entries
- the number of entries
- user-data
- data to pass to the action callbacks
Since 2.4
<gtk-action-group>
) (entries scm
) (value int
) (on_change scm
)This is a convenience routine to create a group of radio actions and add them to the action group.
The "changed" signal of the first radio action is connected to the on-change callback and the accel paths of the actions are set to ‘<Actions>/group-name/action-name’.
- action-group
- the action group
- entries
- an array of radio action descriptions
- n-entries
- the number of entries
- value
- the value of the action to activate initially, or -1 if no action should be activated
- on-change
- the callback to connect to the changed signal
- user-data
- data to pass to the action callbacks
Since 2.4
<gtk-action-group>
) (string mchars
) ⇒ (ret mchars
)Translates a string using the specified
translate-func
. This is mainly intended for language bindings.
- action-group
- a
<gtk-action-group>
- string
- a string
- ret
- the translation of string
Since 2.6