Action
Object Hierarchy:
Description:
[
CCode ( type_id =
"gtk_action_get_type ()" ) ]
[
Version ( deprecated =
true , deprecated_since =
"3.10" , replacement =
"GLib.Action" ) ]
public class Action :
Object,
Buildable
Warning: Action is deprecated since 3.10. Use GLib.Action.
Note:
In GTK+ 3.10, GtkAction has been deprecated. Use Action instead, and
associate actions with Actionable widgets. Use
MenuModel for creating menus with
Menu.from_model.
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 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 Action subclasses.
Each action can have one or more proxy widgets. To act as an action proxy, widget needs to implement
Activatable interface. Proxies mirror the state of the action and should change when
the action’s state changes. Properties that are always mirrored by proxies are
sensitive and visible. gicon
, icon_name, label,
short_label and stock_id
properties are only mirorred if proxy widget has
use_action_appearance property set to true.
When the proxy is activated, it should activate its action.
Content:
Properties:
- public ActionGroup action_group { owned get; set; }
The GtkActionGroup this GtkAction is associated with, or NULL (for
internal use).
- public bool always_show_image { get; set construct; }
If true, the action's menu item
proxies will ignore the gtk_menu_images setting and always show their
image, if available.
- public Icon gicon { get; set; }
The Icon
displayed in the Action.
- public bool hide_if_empty { get; set; }
When TRUE, empty menu proxies for this action are hidden.
- public string icon_name { get; set; }
The name of the icon from the icon theme.
- public bool is_important { get; set; }
Whether the action is considered important.
- public string label { get; set; }
The label used for menu items and buttons that activate this action.
- public string name { get; construct; }
A unique name for the action.
- public bool sensitive { get; set; }
Whether the action is enabled.
- public string short_label { get; set; }
A shorter label that may be used on toolbar buttons.
- public string stock_id { get; set; }
The stock icon displayed in widgets representing this action.
- public string tooltip { get; set; }
A tooltip for this action.
- public bool visible { get; set; }
Whether the action is visible.
- public bool visible_horizontal { get; set; }
Whether the toolbar item is visible when the toolbar is in a
horizontal orientation.
- public bool visible_overflown { get; set; }
When true, toolitem proxies for this
action are represented in the toolbar overflow menu.
- public bool visible_vertical { get; set; }
Whether the toolbar item is visible when the toolbar is in a vertical
orientation.
Creation methods:
Methods:
Signals:
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface Gtk.Buildable