|
Graphics.UI.Gtk.ActionMenuToolbar.Action | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
An action which can be triggered by a menu or toolbar item
- Module available since Gtk+ version 2.4
|
|
Synopsis |
|
|
|
|
Detail
|
|
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 menu item, toolbar button or other
proxy widgets. Proxies mirror the state of the action (text label, tooltip,
icon, visible, sensitive, etc), and should change when the action's state
changes. When the proxy is activated, it should activate its action.
|
|
Class Hierarchy
|
|
| GObject
| +----Action
| +----ToggleAction
|
|
Types
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructors
|
|
|
:: String | name - A unique name for the action
| -> String | label - the label displayed in menu items and on
buttons
| -> Maybe String | tooltip - a tooltip for the action
| -> Maybe StockId | stockId - the stock icon to display in widgets
representing the action
| -> IO Action | | Creates a new Action object. To add the action to a ActionGroup and
set the accelerator for the action, call
Graphics.UI.Gtk.ActionMenuToolbar.ActionGroup.actionGroupAddActionWithAccel.
See Graphics.UI.Gtk.ActionMenuToolbar.UIManager for information on
allowed action names.
|
|
|
Methods
|
|
|
Returns the name of the action.
|
|
|
:: ActionClass self | | => self | returns True if the action and its associated action group
are both sensitive.
| -> IO Bool | | Returns whether the action is effectively sensitive.
|
|
|
|
:: ActionClass self | | => self | returns True if the action itself is sensitive.
| -> IO Bool | | Returns whether the action itself is sensitive. Note that this doesn't
necessarily mean effective sensitivity. See actionIsSensitive for that.
|
|
|
|
:: ActionClass self | | => self | sensitive - True to make the action sensitive
| -> Bool | | -> IO () | | Sets the sensitive property of the action to sensitive. Note that
this doesn't necessarily mean effective sensitivity. See actionIsSensitive
for that.
- Available since Gtk+ version 2.6
|
|
|
|
:: ActionClass self | | => self | returns True if the action and its associated action group
are both visible.
| -> IO Bool | | Returns whether the action is effectively visible.
|
|
|
|
:: ActionClass self | | => self | returns True if the action itself is visible.
| -> IO Bool | | Returns whether the action itself is visible. Note that this doesn't
necessarily mean effective visibility. See actionIsSensitive for that.
|
|
|
|
:: ActionClass self | | => self | visible - True to make the action visible
| -> Bool | | -> IO () | | Sets the visible property of the action to visible. Note that this
doesn't necessarily mean effective visibility. See actionIsVisible for
that.
- Available since Gtk+ version 2.6
|
|
|
|
Emits the "activate" signal on the specified action, if it isn't
insensitive. This gets called by the proxy widgets when they get activated.
It can also be used to manually activate an action.
|
|
|
:: ActionClass self | | => self | returns a menu item connected to the action.
| -> IO Widget | | Creates a menu item widget that proxies for the given action.
|
|
|
|
:: ActionClass self | | => self | returns a toolbar item connected to the action.
| -> IO Widget | | Creates a toolbar item widget that proxies for the given action.
|
|
|
|
:: (ActionClass self, WidgetClass proxy) | | => self | proxy - the proxy widget
| -> proxy | | -> IO () | | Connects a widget to an action object as a proxy. Synchronises various
properties of the action with the widget (such as label text, icon, tooltip,
etc), and attaches a callback so that the action gets activated when the
proxy widget does.
If the widget is already connected to an action, it is disconnected
first.
|
|
|
|
:: (ActionClass self, WidgetClass proxy) | | => self | proxy - the proxy widget
| -> proxy | | -> IO () | | Disconnects a proxy widget from an action.
|
|
|
|
Returns the proxy widgets for an action.
|
|
|
Installs the accelerator for action if action has an accel path and
group. See actionSetAccelPath and actionSetAccelGroup
Since multiple proxies may independently trigger the installation of the
accelerator, the action counts the number of times this function has been
called and doesn't remove the accelerator until
actionDisconnectAccelerator has been called as many times.
|
|
|
Undoes the effect of one call to actionConnectAccelerator.
|
|
|
:: ActionClass self | | => self | returns the accel path for this action, or
Nothing if none is set.
| -> IO (Maybe String) | | Returns the accel path for this action.
- Available since Gtk+ version 2.6
|
|
|
|
:: ActionClass self | | => self | accelPath - the accelerator path
| -> String | | -> IO () | | Sets the accel path for this action. All proxy widgets associated with
the action will have this accel path, so that their accelerators are
consistent.
|
|
|
|
Sets the AccelGroup in which the accelerator for this action will be
installed.
|
|
Attributes
|
|
|
A unique name for the action.
Default value: ""
|
|
|
The label used for menu items and buttons that activate this action.
Default value: ""
|
|
|
A shorter label that may be used on toolbar buttons.
Default value: ""
|
|
|
A tooltip for this action.
Default value: Nothing
|
|
|
The stock icon displayed in widgets representing this action.
Default value: Nothing
|
|
|
Whether the toolbar item is visible when the toolbar is in a horizontal
orientation.
Default value: True
|
|
|
When True, toolitem proxies for this action are represented in the
toolbar overflow menu.
Default value: True
- Available since Gtk+ version 2.6
|
|
|
Whether the toolbar item is visible when the toolbar is in a vertical
orientation.
Default value: True
|
|
|
Whether the action is considered important. When True, toolitem proxies
for this action show text in
Graphics.UI.Gtk.MenuComboToolbar.Toolbar.ToolbarBothHoriz mode.
Default value: False
|
|
|
When True, empty menu proxies for this action are hidden.
Default value: True
|
|
|
Whether the action is enabled.
Default value: True
- Available since Gtk+ version 2.6
|
|
|
Whether the action is visible.
Default value: True
- Available since Gtk+ version 2.6
|
|
|
'accelPath' property. See actionGetAccelPath and actionSetAccelPath
- Available since Gtk+ version 2.6
|
|
Signals
|
|
|
The "activate" signal is emitted when the action is activated.
|
|
Deprecated
|
|
|
|
|
The "activate" signal is emitted when the action is activated.
|
|
Produced by Haddock version 2.6.0 |