Package: gtk

Class gtk-action

Superclasses

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

Documented Subclasses

Direct Slots

action-group
The action-group property of type gtk-action-group (Read / Write)
The action group the action is associated with, or nil for internal use.
always-show-image
The always-show-image property of type :boolean (Read / Write / Construct)
If true, the menu item proxies of the action will ignore the gtk-menu-images setting and always show their image, if available. Use this property if the menu item would be useless or hard to use without their image.
Default value: false
gicon
The gicon property of type g-icon (Read / Write)
The icon displayed in the action. Note that the stock icon is preferred, if the stock-id property holds the ID of an existing stock icon. This is an appearance property and thus only applies if the use-action-appearance property is true.
hide-if-empty
The hide-if-empty property of type :boolean (Read / Write)
When true, empty menu proxies for this action are hidden.
Default value: true
icon-name
The icon-name property of type :string (Read / Write)
The name of the icon from the icon theme. Note that the stock icon is preferred, if the stock-id property holds the ID of an existing stock icon, and the g-icon object is preferred if the gicon property is set. This is an appearance property and thus only applies if the use-action-appearance property is true.
Default value: nil
is-important
The is-important property of type :boolean (Read / Write)
Whether the action is considered important. When true, toolitem proxies for this action show text in :both-horiz mode.
Default value: false
label
The label property of type :string (Read / Write)
The label used for menu items and buttons that activate this action. If the label is nil, GTK uses the stock label specified via the stock-id property. This is an appearance property and thus only applies if the use-action-appearance property is true.
Default value: nil
name
The name property of type :string (Read / Write / Construct)
A unique name for the action.
Default value: nil
sensitive
The sensitive property of type :boolean (Read / Write)
Whether the action is enabled.
Default value: true
short-label
The short-label property of type :string (Read / Write)
A shorter label that may be used on toolbar buttons. This is an appearance property and thus only applies if the use-action-appearance property is true.
Default value: nil
stock-id
The stock-id property of type :string (Read / Write)
The stock icon displayed in widgets representing this action. This is an appearance property and thus only applies if the use-action-appearance property is true.
Default value: nil
tooltip
The tooltip property of type :string (Read / Write)
A tooltip for this action.
Default value: nil
visible
The visible property of type :boolean (Read / Write)
Whether the action is visible.
Default value: true
visible-horizontal
The visible-horizontal property of type :boolean (Read / Write)
Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
Default value: true
visible-overflown
The visible-overflown property of type :boolean (Read / Write)
When true, toolitem proxies for this action are represented in the toolbar overflow menu.
Default value: true
visible-vertical
The visible-vertical property of type :boolean (Read / Write)
Whether the toolbar item is visible when the toolbar is in a vertical orientation.
Default value: true

Details

Actions represent operations that the user can be perform, along with some information how it should be presented in the interface. Each action provides methods to create icons, menu items and toolbar items representing itself.

As well as the callback function that is called when the action gets activated, the following also gets associated with the action:
  • a name, not translated, for path lookup
  • a label, translated, for display
  • an accelerator
  • whether label indicates a stock ID
  • a tooltip, optional, translated
  • a toolbar label, optional, shorter than label
The action will also have some state information:
  • visible, shown/hidden
  • sensitive, enabled/disabled
Apart from regular actions, there are toggle actions, which can be toggled between two states and radio actions, of which only one in a group can be in the "active" state. Other actions can be implemented as gtk-action subclasses.

Each action can have one or more proxy widgets. To act as an action proxy, the widget needs to implement the gtk-activatable interface. Proxies mirror the state of the action and should change when the state of the action changes. Properties that are always mirrored by proxies are sensitive and visible. The gicon, icon-name, label, short-label and stock-id properties are only mirorred if the proxy widget has the use-action-appearance property set to true.

When the proxy is activated, it should activate its action.

Warning

The gtk-action class has been deprecated since GTK 3.10. Use the g-action interface instead, and associate actions with gtk-actionable widgets. Use the g-menu-model class for creating menus with the function gtk-menu-new-from-model.

Signal Details

The "activate" signal
 lambda (action)    :no-recurse      
The signal is emitted when the action is activated.
action
The gtk-action object which received the signal.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2021-7-24