Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- activate
- blockActivate
- connectAccelerator
- createIcon
- createMenu
- createMenuItem
- createToolItem
- disconnectAccelerator
- getAccelClosure
- getAccelPath
- getAlwaysShowImage
- getGicon
- getIconName
- getIsImportant
- getLabel
- getName
- getProxies
- getSensitive
- getShortLabel
- getStockId
- getTooltip
- getVisible
- getVisibleHorizontal
- getVisibleVertical
- isSensitive
- isVisible
- new
- setAccelGroup
- setAccelPath
- setAlwaysShowImage
- setGicon
- setIconName
- setIsImportant
- setLabel
- setSensitive
- setShortLabel
- setStockId
- setTooltip
- setVisible
- setVisibleHorizontal
- setVisibleVertical
- unblockActivate
- Properties
- Signals
In GTK+ 3.10, GtkAction has been deprecated. Use 'GI.Gio.Interfaces.Action.Action' instead, and associate actions with 'GI.Gtk.Interfaces.Actionable.Actionable' widgets. Use 'GI.Gio.Objects.MenuModel.MenuModel' for creating menus with 'GI.Gtk.Objects.Menu.menuNewFromModel'.
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][GtkToggleAction],
which can be toggled between two states and
[radio actions][GtkRadioAction], 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 Action
:sensitive
and
Action
:visible
. Action
:gicon
, Action
:icon-name
, Action
:label
,
Action
:short-label
and Action
:stock-id
properties are only mirorred
if proxy widget has Activatable
:use-action-appearance
property set to
True
.
When the proxy is activated, it should activate its action.
Synopsis
- newtype Action = Action (ManagedPtr Action)
- class GObject o => IsAction o
- toAction :: (MonadIO m, IsAction o) => o -> m Action
- noAction :: Maybe Action
- actionActivate :: (HasCallStack, MonadIO m, IsAction a) => a -> m ()
- actionBlockActivate :: (HasCallStack, MonadIO m, IsAction a) => a -> m ()
- actionConnectAccelerator :: (HasCallStack, MonadIO m, IsAction a) => a -> m ()
- actionCreateIcon :: (HasCallStack, MonadIO m, IsAction a) => a -> Int32 -> m Widget
- actionCreateMenu :: (HasCallStack, MonadIO m, IsAction a) => a -> m Widget
- actionCreateMenuItem :: (HasCallStack, MonadIO m, IsAction a) => a -> m Widget
- actionCreateToolItem :: (HasCallStack, MonadIO m, IsAction a) => a -> m Widget
- actionDisconnectAccelerator :: (HasCallStack, MonadIO m, IsAction a) => a -> m ()
- actionGetAccelClosure :: (HasCallStack, MonadIO m, IsAction a) => a -> m Closure
- actionGetAccelPath :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetAlwaysShowImage :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionGetGicon :: (HasCallStack, MonadIO m, IsAction a) => a -> m Icon
- actionGetIconName :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetIsImportant :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionGetLabel :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetName :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetProxies :: (HasCallStack, MonadIO m, IsAction a) => a -> m [Widget]
- actionGetSensitive :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionGetShortLabel :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetStockId :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetTooltip :: (HasCallStack, MonadIO m, IsAction a) => a -> m Text
- actionGetVisible :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionGetVisibleHorizontal :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionGetVisibleVertical :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionIsSensitive :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionIsVisible :: (HasCallStack, MonadIO m, IsAction a) => a -> m Bool
- actionNew :: (HasCallStack, MonadIO m) => Text -> Maybe Text -> Maybe Text -> Maybe Text -> m Action
- actionSetAccelGroup :: (HasCallStack, MonadIO m, IsAction a, IsAccelGroup b) => a -> Maybe b -> m ()
- actionSetAccelPath :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> m ()
- actionSetAlwaysShowImage :: (HasCallStack, MonadIO m, IsAction a) => a -> Bool -> m ()
- actionSetGicon :: (HasCallStack, MonadIO m, IsAction a, IsIcon b) => a -> b -> m ()
- actionSetIconName :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> m ()
- actionSetIsImportant :: (HasCallStack, MonadIO m, IsAction a) => a -> Bool -> m ()
- actionSetLabel :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> m ()
- actionSetSensitive :: (HasCallStack, MonadIO m, IsAction a) => a -> Bool -> m ()
- actionSetShortLabel :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> m ()
- actionSetStockId :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> m ()
- actionSetTooltip :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> m ()
- actionSetVisible :: (HasCallStack, MonadIO m, IsAction a) => a -> Bool -> m ()
- actionSetVisibleHorizontal :: (HasCallStack, MonadIO m, IsAction a) => a -> Bool -> m ()
- actionSetVisibleVertical :: (HasCallStack, MonadIO m, IsAction a) => a -> Bool -> m ()
- actionUnblockActivate :: (HasCallStack, MonadIO m, IsAction a) => a -> m ()
- clearActionActionGroup :: (MonadIO m, IsAction o) => o -> m ()
- constructActionActionGroup :: (IsAction o, IsActionGroup a) => a -> IO (GValueConstruct o)
- getActionActionGroup :: (MonadIO m, IsAction o) => o -> m (Maybe ActionGroup)
- setActionActionGroup :: (MonadIO m, IsAction o, IsActionGroup a) => o -> a -> m ()
- constructActionAlwaysShowImage :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionAlwaysShowImage :: (MonadIO m, IsAction o) => o -> m Bool
- setActionAlwaysShowImage :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionGicon :: (IsAction o, IsIcon a) => a -> IO (GValueConstruct o)
- getActionGicon :: (MonadIO m, IsAction o) => o -> m Icon
- setActionGicon :: (MonadIO m, IsAction o, IsIcon a) => o -> a -> m ()
- constructActionHideIfEmpty :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionHideIfEmpty :: (MonadIO m, IsAction o) => o -> m Bool
- setActionHideIfEmpty :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionIconName :: IsAction o => Text -> IO (GValueConstruct o)
- getActionIconName :: (MonadIO m, IsAction o) => o -> m Text
- setActionIconName :: (MonadIO m, IsAction o) => o -> Text -> m ()
- constructActionIsImportant :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionIsImportant :: (MonadIO m, IsAction o) => o -> m Bool
- setActionIsImportant :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionLabel :: IsAction o => Text -> IO (GValueConstruct o)
- getActionLabel :: (MonadIO m, IsAction o) => o -> m Text
- setActionLabel :: (MonadIO m, IsAction o) => o -> Text -> m ()
- constructActionName :: IsAction o => Text -> IO (GValueConstruct o)
- getActionName :: (MonadIO m, IsAction o) => o -> m Text
- constructActionSensitive :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionSensitive :: (MonadIO m, IsAction o) => o -> m Bool
- setActionSensitive :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionShortLabel :: IsAction o => Text -> IO (GValueConstruct o)
- getActionShortLabel :: (MonadIO m, IsAction o) => o -> m Text
- setActionShortLabel :: (MonadIO m, IsAction o) => o -> Text -> m ()
- constructActionStockId :: IsAction o => Text -> IO (GValueConstruct o)
- getActionStockId :: (MonadIO m, IsAction o) => o -> m Text
- setActionStockId :: (MonadIO m, IsAction o) => o -> Text -> m ()
- constructActionTooltip :: IsAction o => Text -> IO (GValueConstruct o)
- getActionTooltip :: (MonadIO m, IsAction o) => o -> m Text
- setActionTooltip :: (MonadIO m, IsAction o) => o -> Text -> m ()
- constructActionVisible :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionVisible :: (MonadIO m, IsAction o) => o -> m Bool
- setActionVisible :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionVisibleHorizontal :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionVisibleHorizontal :: (MonadIO m, IsAction o) => o -> m Bool
- setActionVisibleHorizontal :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionVisibleOverflown :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionVisibleOverflown :: (MonadIO m, IsAction o) => o -> m Bool
- setActionVisibleOverflown :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- constructActionVisibleVertical :: IsAction o => Bool -> IO (GValueConstruct o)
- getActionVisibleVertical :: (MonadIO m, IsAction o) => o -> m Bool
- setActionVisibleVertical :: (MonadIO m, IsAction o) => o -> Bool -> m ()
- type ActionActivateCallback = IO ()
- type C_ActionActivateCallback = Ptr () -> Ptr () -> IO ()
- afterActionActivate :: (IsAction a, MonadIO m) => a -> ActionActivateCallback -> m SignalHandlerId
- genClosure_ActionActivate :: ActionActivateCallback -> IO Closure
- mk_ActionActivateCallback :: C_ActionActivateCallback -> IO (FunPtr C_ActionActivateCallback)
- noActionActivateCallback :: Maybe ActionActivateCallback
- onActionActivate :: (IsAction a, MonadIO m) => a -> ActionActivateCallback -> m SignalHandlerId
- wrap_ActionActivateCallback :: ActionActivateCallback -> C_ActionActivateCallback
Exported types
Memory-managed wrapper type.
Instances
GObject Action Source # | |
Defined in GI.Gtk.Objects.Action gobjectType :: Action -> IO GType # | |
IsObject Action Source # | |
Defined in GI.Gtk.Objects.Action | |
IsBuildable Action Source # | |
Defined in GI.Gtk.Objects.Action | |
IsAction Action Source # | |
Defined in GI.Gtk.Objects.Action |
class GObject o => IsAction o Source #
Instances
(GObject a, (UnknownAncestorError Action a :: Constraint)) => IsAction a Source # | |
Defined in GI.Gtk.Objects.Action | |
IsAction Action Source # | |
Defined in GI.Gtk.Objects.Action | |
IsAction RecentAction Source # | |
Defined in GI.Gtk.Objects.RecentAction | |
IsAction ToggleAction Source # | |
Defined in GI.Gtk.Objects.ToggleAction | |
IsAction RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction |
Methods
activate
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.10)Use actionGroupActivateAction
on a Action
instead
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.
Since: 2.4
blockActivate
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.10)Use simpleActionSetEnabled
to disable theSimpleAction
instead
Disable activation signals from the action
This is needed when updating the state of your proxy
Activatable
widget could result in calling actionActivate
,
this is a convenience function to avoid recursing in those
cases (updating toggle state for instance).
Since: 2.16
connectAccelerator
actionConnectAccelerator Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m () |
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.
Since: 2.4
createIcon
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Int32 |
|
-> m Widget | Returns: a widget that displays the icon for this action. |
Deprecated: (Since version 3.10)Use menuItemSetIcon
to set an icon on a MenuItem
,or containerAdd
to add a Image
to a Button
This function is intended for use by action implementations to create icons displayed in the proxy widgets.
Since: 2.4
createMenu
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Widget | Returns: the menu item provided by the
action, or |
Deprecated: (Since version 3.10)Use Action
and MenuModel
instead, and create aMenu
with menuNewFromModel
If action
provides a Menu
widget as a submenu for the menu
item or the toolbar item it creates, this function returns an
instance of that menu.
Since: 2.12
createMenuItem
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Widget | Returns: a menu item connected to the action. |
Deprecated: (Since version 3.10)Use menuItemNew
and associate it with a Action
instead.
Creates a menu item widget that proxies for the given action.
Since: 2.4
createToolItem
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Widget | Returns: a toolbar item connected to the action. |
Deprecated: (Since version 3.10)Use a ToolItem
and associate it with a Action
usingactionableSetActionName
instead
Creates a toolbar item widget that proxies for the given action.
Since: 2.4
disconnectAccelerator
actionDisconnectAccelerator Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m () |
Undoes the effect of one call to actionConnectAccelerator
.
Since: 2.4
getAccelClosure
actionGetAccelClosure Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Closure | Returns: the accel closure for this action. The returned closure is owned by GTK+ and must not be unreffed or modified. |
getAccelPath
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the accel path for this action, or |
getAlwaysShowImage
actionGetAlwaysShowImage Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.10)Use menuItemGetAttributeValue
on a MenuItem
instead
Returns whether action
's menu item proxies will always
show their image, if available.
Since: 2.20
getGicon
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Icon | Returns: The action’s |
Deprecated: (Since version 3.10)Use Action
instead, andmenuItemGetAttributeValue
to get an icon from a MenuItem
associated with a Action
Gets the gicon of action
.
Since: 2.16
getIconName
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the icon name |
Deprecated: (Since version 3.10)Use Action
instead, andmenuItemGetAttributeValue
to get an icon from a MenuItem
associated with a Action
Gets the icon name of action
.
Since: 2.16
getIsImportant
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: whether |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor whetherlabels are shown directly
Checks whether action
is important or not
Since: 2.16
getLabel
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the label text |
Deprecated: (Since version 3.10)Use Action
instead, and get a label from a menu itemwith menuItemGetAttributeValue
. For Actionable
widgets, use thewidget-specific API to get a label
Gets the label text of action
.
Since: 2.16
getName
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the name of the action. The string belongs to GTK+ and should not be freed. |
Deprecated: (Since version 3.10)Use actionGetName
on a Action
instead
Returns the name of the action.
Since: 2.4
getProxies
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m [Widget] | Returns: a |
Deprecated: (Since version 3.10)
Returns the proxy widgets for an action.
See also activatableGetRelatedAction
.
Since: 2.4
getSensitive
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.10)Use actionGetEnabled
on a Action
instead
Returns whether the action itself is sensitive. Note that this doesn’t
necessarily mean effective sensitivity. See actionIsSensitive
for that.
Since: 2.4
getShortLabel
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the short label text. |
Deprecated: (Since version 3.10)Use Action
instead, which has no equivalent of shortlabels
Gets the short label text of action
.
Since: 2.16
getStockId
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the stock id |
Deprecated: (Since version 3.10)Use Action
instead, which has no equivalent of stockitems
Gets the stock id of action
.
Since: 2.16
getTooltip
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Text | Returns: the tooltip text |
Deprecated: (Since version 3.10)Use Action
instead, and get tooltips from associatedActionable
widgets with widgetGetTooltipText
Gets the tooltip text of action
.
Since: 2.16
getVisible
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor the state ofActionable
widgets directly
Returns whether the action itself is visible. Note that this doesn’t
necessarily mean effective visibility. See actionIsSensitive
for that.
Since: 2.4
getVisibleHorizontal
actionGetVisibleHorizontal Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: whether |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor thevisibility of associated widgets and menu items directly
Checks whether action
is visible when horizontal
Since: 2.16
getVisibleVertical
actionGetVisibleVertical Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: whether |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor thevisibility of associated widgets and menu items directly
Checks whether action
is visible when horizontal
Since: 2.16
isSensitive
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.10)Use actionGetEnabled
on a Action
instead
Returns whether the action is effectively sensitive.
Since: 2.4
isVisible
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor the state ofActionable
widgets directly
Returns whether the action is effectively visible.
Since: 2.4
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m Action | Returns: a new |
Deprecated: (Since version 3.10)Use Action
instead, associating it to a widget withActionable
or creating a Menu
with menuNewFromModel
Creates a new Action
object. To add the action to a
ActionGroup
and set the accelerator for the action,
call actionGroupAddActionWithAccel
.
See the [UI Definition section][XML-UI] for information on allowed action
names.
Since: 2.4
setAccelGroup
:: (HasCallStack, MonadIO m, IsAction a, IsAccelGroup b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the AccelGroup
in which the accelerator for this action
will be installed.
Since: 2.4
setAccelPath
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> m () |
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.
Note that accelPath
string will be stored in a GQuark
. Therefore, if you
pass a static string, you can save some memory by interning it first with
internStaticString
.
Since: 2.4
setAlwaysShowImage
actionSetAlwaysShowImage Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.10)Use menuItemSetIcon
on a MenuItem
instead, if theitem should have an image
Sets whether action
's menu item proxies will ignore the
Settings
:gtk-menu-images
setting and always show their image, if available.
Use this if the menu item would be useless or hard to use without their image.
Since: 2.20
setGicon
:: (HasCallStack, MonadIO m, IsAction a, IsIcon b) | |
=> a |
|
-> b |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and menuItemSetIcon
to set anicon on a MenuItem
associated with a Action
, or containerAdd
toadd a Image
to a Button
Sets the icon of action
.
Since: 2.16
setIconName
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and menuItemSetIcon
to set anicon on a MenuItem
associated with a Action
, or containerAdd
toadd a Image
to a Button
Sets the icon name on action
Since: 2.16
setIsImportant
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor whetherlabels are shown directly
Sets whether the action is important, this attribute is used primarily by toolbar items to decide whether to show a label or not.
Since: 2.16
setLabel
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and set a label on a menu item withmenuItemSetLabel
. For Actionable
widgets, use the widget-specificAPI to set a label
Sets the label of action
.
Since: 2.16
setSensitive
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.10)Use simpleActionSetEnabled
on a SimpleAction
instead
Sets the :sensitive property of the action to sensitive
. Note that
this doesn’t necessarily mean effective sensitivity. See
actionIsSensitive
for that.
Since: 2.6
setShortLabel
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, which has no equivalent of shortlabels
Sets a shorter label text on action
.
Since: 2.16
setStockId
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, which has no equivalent of stockitems
Sets the stock id on action
Since: 2.16
setTooltip
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and set tooltips on associatedActionable
widgets with widgetSetTooltipText
Sets the tooltip text on action
Since: 2.16
setVisible
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor the state ofActionable
widgets directly
Sets the :visible property of the action to visible
. Note that
this doesn’t necessarily mean effective visibility. See
actionIsVisible
for that.
Since: 2.6
setVisibleHorizontal
actionSetVisibleHorizontal Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor thevisibility of associated widgets and menu items directly
Sets whether action
is visible when horizontal
Since: 2.16
setVisibleVertical
actionSetVisibleVertical Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.10)Use Action
instead, and control and monitor thevisibility of associated widgets and menu items directly
Sets whether action
is visible when vertical
Since: 2.16
unblockActivate
actionUnblockActivate Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.10)Use simpleActionSetEnabled
to enable theSimpleAction
instead
Reenable activation signals from the action
Since: 2.16
Properties
actionGroup
The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).
clearActionActionGroup :: (MonadIO m, IsAction o) => o -> m () Source #
Set the value of the “action-group
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#actionGroup
constructActionActionGroup :: (IsAction o, IsActionGroup a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “action-group
” property. This is rarely needed directly, but it is used by new
.
getActionActionGroup :: (MonadIO m, IsAction o) => o -> m (Maybe ActionGroup) Source #
Get the value of the “action-group
” property.
When overloading is enabled, this is equivalent to
get
action #actionGroup
setActionActionGroup :: (MonadIO m, IsAction o, IsActionGroup a) => o -> a -> m () Source #
Set the value of the “action-group
” property.
When overloading is enabled, this is equivalent to
set
action [ #actionGroup:=
value ]
alwaysShowImage
If True
, the action's menu item proxies will ignore the Settings
: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.
Since: 2.20
constructActionAlwaysShowImage :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “always-show-image
” property. This is rarely needed directly, but it is used by new
.
getActionAlwaysShowImage :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “always-show-image
” property.
When overloading is enabled, this is equivalent to
get
action #alwaysShowImage
setActionAlwaysShowImage :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “always-show-image
” property.
When overloading is enabled, this is equivalent to
set
action [ #alwaysShowImage:=
value ]
gicon
The Icon
displayed in the Action
.
Note that the stock icon is preferred, if the Action
:stock-id
property holds the id of an existing stock icon.
This is an appearance property and thus only applies if
Activatable
:use-action-appearance
is True
.
Since: 2.16
constructActionGicon :: (IsAction o, IsIcon a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “gicon
” property. This is rarely needed directly, but it is used by new
.
getActionGicon :: (MonadIO m, IsAction o) => o -> m Icon Source #
Get the value of the “gicon
” property.
When overloading is enabled, this is equivalent to
get
action #gicon
setActionGicon :: (MonadIO m, IsAction o, IsIcon a) => o -> a -> m () Source #
Set the value of the “gicon
” property.
When overloading is enabled, this is equivalent to
set
action [ #gicon:=
value ]
hideIfEmpty
When TRUE, empty menu proxies for this action are hidden.
constructActionHideIfEmpty :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “hide-if-empty
” property. This is rarely needed directly, but it is used by new
.
getActionHideIfEmpty :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “hide-if-empty
” property.
When overloading is enabled, this is equivalent to
get
action #hideIfEmpty
setActionHideIfEmpty :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “hide-if-empty
” property.
When overloading is enabled, this is equivalent to
set
action [ #hideIfEmpty:=
value ]
iconName
The name of the icon from the icon theme.
Note that the stock icon is preferred, if the Action
:stock-id
property holds the id of an existing stock icon, and the Icon
is
preferred if the Action
:gicon
property is set.
This is an appearance property and thus only applies if
Activatable
:use-action-appearance
is True
.
Since: 2.10
constructActionIconName :: IsAction o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “icon-name
” property. This is rarely needed directly, but it is used by new
.
getActionIconName :: (MonadIO m, IsAction o) => o -> m Text Source #
Get the value of the “icon-name
” property.
When overloading is enabled, this is equivalent to
get
action #iconName
setActionIconName :: (MonadIO m, IsAction o) => o -> Text -> m () Source #
Set the value of the “icon-name
” property.
When overloading is enabled, this is equivalent to
set
action [ #iconName:=
value ]
isImportant
Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.
constructActionIsImportant :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “is-important
” property. This is rarely needed directly, but it is used by new
.
getActionIsImportant :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “is-important
” property.
When overloading is enabled, this is equivalent to
get
action #isImportant
setActionIsImportant :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “is-important
” property.
When overloading is enabled, this is equivalent to
set
action [ #isImportant:=
value ]
label
The label used for menu items and buttons that activate
this action. If the label is Nothing
, GTK+ uses the stock
label specified via the stock-id property.
This is an appearance property and thus only applies if
Activatable
:use-action-appearance
is True
.
constructActionLabel :: IsAction o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “label
” property. This is rarely needed directly, but it is used by new
.
getActionLabel :: (MonadIO m, IsAction o) => o -> m Text Source #
Get the value of the “label
” property.
When overloading is enabled, this is equivalent to
get
action #label
setActionLabel :: (MonadIO m, IsAction o) => o -> Text -> m () Source #
Set the value of the “label
” property.
When overloading is enabled, this is equivalent to
set
action [ #label:=
value ]
name
A unique name for the action.
constructActionName :: IsAction o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “name
” property. This is rarely needed directly, but it is used by new
.
getActionName :: (MonadIO m, IsAction o) => o -> m Text Source #
Get the value of the “name
” property.
When overloading is enabled, this is equivalent to
get
action #name
sensitive
Whether the action is enabled.
constructActionSensitive :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “sensitive
” property. This is rarely needed directly, but it is used by new
.
getActionSensitive :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “sensitive
” property.
When overloading is enabled, this is equivalent to
get
action #sensitive
setActionSensitive :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “sensitive
” property.
When overloading is enabled, this is equivalent to
set
action [ #sensitive:=
value ]
shortLabel
A shorter label that may be used on toolbar buttons.
This is an appearance property and thus only applies if
Activatable
:use-action-appearance
is True
.
constructActionShortLabel :: IsAction o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “short-label
” property. This is rarely needed directly, but it is used by new
.
getActionShortLabel :: (MonadIO m, IsAction o) => o -> m Text Source #
Get the value of the “short-label
” property.
When overloading is enabled, this is equivalent to
get
action #shortLabel
setActionShortLabel :: (MonadIO m, IsAction o) => o -> Text -> m () Source #
Set the value of the “short-label
” property.
When overloading is enabled, this is equivalent to
set
action [ #shortLabel:=
value ]
stockId
The stock icon displayed in widgets representing this action.
This is an appearance property and thus only applies if
Activatable
:use-action-appearance
is True
.
constructActionStockId :: IsAction o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “stock-id
” property. This is rarely needed directly, but it is used by new
.
getActionStockId :: (MonadIO m, IsAction o) => o -> m Text Source #
Get the value of the “stock-id
” property.
When overloading is enabled, this is equivalent to
get
action #stockId
setActionStockId :: (MonadIO m, IsAction o) => o -> Text -> m () Source #
Set the value of the “stock-id
” property.
When overloading is enabled, this is equivalent to
set
action [ #stockId:=
value ]
tooltip
A tooltip for this action.
constructActionTooltip :: IsAction o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “tooltip
” property. This is rarely needed directly, but it is used by new
.
getActionTooltip :: (MonadIO m, IsAction o) => o -> m Text Source #
Get the value of the “tooltip
” property.
When overloading is enabled, this is equivalent to
get
action #tooltip
setActionTooltip :: (MonadIO m, IsAction o) => o -> Text -> m () Source #
Set the value of the “tooltip
” property.
When overloading is enabled, this is equivalent to
set
action [ #tooltip:=
value ]
visible
Whether the action is visible.
constructActionVisible :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “visible
” property. This is rarely needed directly, but it is used by new
.
getActionVisible :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “visible
” property.
When overloading is enabled, this is equivalent to
get
action #visible
setActionVisible :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “visible
” property.
When overloading is enabled, this is equivalent to
set
action [ #visible:=
value ]
visibleHorizontal
Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
constructActionVisibleHorizontal :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “visible-horizontal
” property. This is rarely needed directly, but it is used by new
.
getActionVisibleHorizontal :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “visible-horizontal
” property.
When overloading is enabled, this is equivalent to
get
action #visibleHorizontal
setActionVisibleHorizontal :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “visible-horizontal
” property.
When overloading is enabled, this is equivalent to
set
action [ #visibleHorizontal:=
value ]
visibleOverflown
When True
, toolitem proxies for this action are represented in the
toolbar overflow menu.
Since: 2.6
constructActionVisibleOverflown :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “visible-overflown
” property. This is rarely needed directly, but it is used by new
.
getActionVisibleOverflown :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “visible-overflown
” property.
When overloading is enabled, this is equivalent to
get
action #visibleOverflown
setActionVisibleOverflown :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “visible-overflown
” property.
When overloading is enabled, this is equivalent to
set
action [ #visibleOverflown:=
value ]
visibleVertical
Whether the toolbar item is visible when the toolbar is in a vertical orientation.
constructActionVisibleVertical :: IsAction o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “visible-vertical
” property. This is rarely needed directly, but it is used by new
.
getActionVisibleVertical :: (MonadIO m, IsAction o) => o -> m Bool Source #
Get the value of the “visible-vertical
” property.
When overloading is enabled, this is equivalent to
get
action #visibleVertical
setActionVisibleVertical :: (MonadIO m, IsAction o) => o -> Bool -> m () Source #
Set the value of the “visible-vertical
” property.
When overloading is enabled, this is equivalent to
set
action [ #visibleVertical:=
value ]
Signals
activate
type ActionActivateCallback = IO () Source #
Deprecated: (Since version 3.10)Use SimpleAction
::activate
instead
The "activate" signal is emitted when the action is activated.
Since: 2.4
type C_ActionActivateCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterActionActivate :: (IsAction a, MonadIO m) => a -> ActionActivateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “activate
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
action #activate callback
genClosure_ActionActivate :: ActionActivateCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ActionActivateCallback :: C_ActionActivateCallback -> IO (FunPtr C_ActionActivateCallback) Source #
Generate a function pointer callable from C code, from a C_ActionActivateCallback
.
noActionActivateCallback :: Maybe ActionActivateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ActionActivateCallback
onActionActivate :: (IsAction a, MonadIO m) => a -> ActionActivateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “activate
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
action #activate callback