GtkAction
An action which can be triggered by a menu or toolbar item.
Object Hierarchy
Direct Subclasses
Description
Actions are basically some operation that you want the user to perform. Hence, actions are usually linked to some event that triggers it. Each action provides methods to create icons, menu items and toolbar items that represent itself.
GtkAction allows you to create such actions, use methods to represent it, and actually perform that action when the event occurs. The following may be associated with an action:
The action will also have certain state information attached to it:
- A name (This is not transalated and is for internal use of the programmer)
- A label (Translated and displayed on the screen)
- An accelerator (The "shortcut-key" that triggers the action)
- Whether or not the label indicates a stock ID
- A tooltip (Translated and displyed on mouse over)
- A toolbar label (Translated and shorter than a label)
- The Callback (Function that specifies the action to be performed
Each action may have one or more proxies, such as menu items, toolbar buttons or other such proxy widgets. Proxies basically mirror the state of the action (text label, tooltip, icon, visible etc.) and should change when the action's state changes. When the proxy is activated, it should activate its action (through the associated callback).
See also: GtkToggleAction and GtkRadioAction.
Constructors
GtkAction (string name, string label, string tooltip, string stock_id);-- Creates an action associated to the various parameters.
Methods
activate() Emits "activate" signal on specified action. block_activate_from() Disables calls to the activate() method. connect_accelerator() Installs the accelerator for the specified action. connect_proxy() Connects a widget to an action object as a proxy create_icon() Creates an icon associated with the specified action. create_menu_item() Creates a menu item widget that proxies for the given action. create_tool_item() Creates a toolbar item widget that proxies for the given action. disconnect_accelerator() Uninstalls the accelerator for the specified action. disconnect_proxy() Disconnects a proxy widget from an action. get_accel_path() Returns the accelerator path for the specified action get_name() Returns the name of the specified action. get_sensitive() Returns current sensitive state get_visible() Returns current state of visibility is_sensitive() Identifies if action is currently sensitive is_visible() Identifies if action is currently visible set_accel_group() Sets the GtkAccelGroup in which the accelerator for this action will be installed. set_accel_path() Sets the accel path for the specified action. set_sensitive() Sets sensitive state for the action set_visible() Sets visible state for the action unblock_activate_from() Re-enables calls to the activate()
Signals
"activate" Emitted when the action is triggered (or activated!)