gtk.action_group
Module for [ActionGroup] class
Types 3
Actions are organised into groups. An action group is essentially a map from names to #GtkAction 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 ## {#Action-Accel}
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.
GtkActionGroup as GtkBuildable # {#GtkActionGroup-BUILDER-UI}
The #GtkActionGroup implementation of the #GtkBuildable interface accepts #GtkAction objects as <child> elements in UI definitions.
Note that it is probably more common to define actions and action groups in the code, since they are directly related to what the code can do.
The GtkActionGroup implementation of the GtkBuildable interface supports a custom <accelerator> element, which has attributes named “key“ and “modifiers“ and allows to specify accelerators. This is similar to the <accelerator> element of #GtkWidget, the main difference is that it doesn’t allow you to specify a signal.
A #GtkDialog UI definition fragment.
<object class="GtkActionGroup" id="actiongroup">
<child>
<object class="GtkAction" id="About">
<property name="name">About</property>
<property name="stock_id">gtk-about</property>
<signal handler="about_activate" name="activate"/>
</object>
<accelerator key="F1" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK"/>
</child>
</object>ActionGroupGidBuilder builder() static nothrowGet builder for [gtk.action_group.ActionGroup] Returns: New builder objectgtk.accel_group.AccelGroup accelGroup() @property nothrowGet `accelGroup` property. Returns: The accelerator group the actions of this group should use.void accelGroup(gtk.accel_group.AccelGroup propval) @property nothrowSet `accelGroup` property. Params: propval = The accelerator group the actions of this group should use.bool sensitive() @property nothrowGet `sensitive` property. Returns: Whether the action group is enabled.void sensitive(bool propval) @property nothrowSet `sensitive` property. Params: propval = Whether the action group is enabled.bool visible() @property nothrowGet `visible` property. Returns: Whether the action group is visible.void visible(bool propval) @property nothrowSet `visible` property. Params: propval = Whether the action group is visible.void addAction(gtk.action.Action action) nothrowAdds 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 a...void addActionWithAccel(gtk.action.Action action, string accelerator = null) nothrowAdds an action object to the action group and sets up the accelerator.gtk.accel_group.AccelGroup getAccelGroup() nothrowGets the accelerator group. Returns: the accelerator group associated with this action group or null if there is none.gtk.action.Action getAction(string actionName) nothrowLooks up an action in the action group by name.bool getSensitive() nothrowReturns true if the group is sensitive. The constituent actions can only be logically sensitive (see [gtk.action.Action.isSensitive]) if they are sensitive (see [gtk.action.Action.getSensitive]) a...bool getVisible() nothrowReturns true if the group is visible. The constituent actions can only be logically visible (see [gtk.action.Action.isVisible]) if they are visible (see [gtk.action.Action.getVisible]) and their g...gtk.action.Action[] listActions() nothrowLists the actions in the action group. Returns: an allocated list of the action objects in the action groupvoid setAccelGroup(gtk.accel_group.AccelGroup accelGroup = null) nothrowSets the accelerator group to be used by every action in this group.void setTranslateFunc(gtk.types.TranslateFunc func) nothrowSets a function to be used for translating the label and tooltip of #GtkActionEntrys added by [gtk.action_group.ActionGroup.addActions].void setTranslationDomain(string domain = null) nothrowSets the translation domain and uses [glib.global.dgettext] for translating the label and tooltip of #GtkActionEntrys added by [gtk.action_group.ActionGroup.addActions].string translateString(string string_) nothrowTranslates a string using the function set with [gtk.action_group.ActionGroup.setTranslateFunc]. This is mainly intended for language bindings.gulong connectConnectProxy(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.action.Action)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.widget.Widget)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.action_group.ActionGroup)))
&& Parameters!T.length < 4) nothrowConnect to `ConnectProxy` signal.gulong connectDisconnectProxy(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.action.Action)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.widget.Widget)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.action_group.ActionGroup)))
&& Parameters!T.length < 4) nothrowConnect to `DisconnectProxy` signal.gulong connectPostActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.action.Action)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.action_group.ActionGroup)))
&& Parameters!T.length < 3) nothrowConnect to `PostActivate` signal.gulong connectPreActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.action.Action)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.action_group.ActionGroup)))
&& Parameters!T.length < 3) nothrowConnect to `PreActivate` signal.Fluent builder implementation template for gtk.action_group.ActionGroup
T accelGroup(gtk.accel_group.AccelGroup propval) nothrowSet `accelGroup` property. Params: propval = The accelerator group the actions of this group should use. Returns: Builder instance for fluent chainingT name(string propval) nothrowSet `name` property. Params: propval = A name for the action. Returns: Builder instance for fluent chainingT sensitive(bool propval) nothrowSet `sensitive` property. Params: propval = Whether the action group is enabled. Returns: Builder instance for fluent chainingT visible(bool propval) nothrowSet `visible` property. Params: propval = Whether the action group is visible. Returns: Builder instance for fluent chainingFluent builder for gtk.action_group.ActionGroup