Package: gtk

Class gtk-action-group

Superclasses

gtk-buildable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

accel-group
The accel-group property of type gtk-accel-group (Read / Write)
The accelerator group the actions of this group should use.
name
The name property of type :string (Read / Write / Construct only)
A name for the action group.
Default value: nil
sensitive
The sensitive property of type :boolean (Read / Write)
Whether the action group is enabled.
Default value: true
visible
The visible property of type :boolean (Read / Write)
Whether the action group is visible.
Default value: true

Details

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, e.g. Save, Cut, Copy, Paste. Each of the menus of the window would be constructed from a combination of two action groups.

Accelerators
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.

Warning

The gtk-action-group class has been deprecated since version 3.10 and should not be used in newly written code.

GtkActionGroup as GtkBuildable

The gtk-action-group implementation of the gtk-buildable interface accepts gtk-action 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 gtk-action-group implementation of the gtk-buildable 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 a gtk-widget object, the main difference is that it does not allow you to specify a signal.

Example: A gtk-action-group 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>    

Signal Details

The "connect-proxy" signal
 lambda (group action proxy)      
The 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.
group
The gtk-action-group object.
action
The gtk-action object.
proxy
The gtk-widget proxy.
The "disconnect-proxy" signal
 lambda (group action proxy)        
The signal is emitted after disconnecting a proxy from an action in the group.
group
The gtk-action-group object.
action
The gtk-action object.
proxy
The gtk-widget proxy.
The "post-activate" signal
 lambda (group action)        
The signal is emitted just after the action in the action group is activated.
group
The gtk-action-group object.
action
The gtk-action object.
The "pre-activate" signal
 lambda (group action)        
The signal is emitted just before the action in the action group is activated.
group
The gtk-action-group object.
action
The gtk-action object.
 

Slot Access Functions

Inherited Slot Access Functions

See also

*2021-12-18