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 |
This interface provides a convenient way of associating widgets with
actions on a ApplicationWindow
or Application
.
It primarily consists of two properties: Actionable
:action-name
and Actionable
:action-target
. There are also some convenience APIs
for setting these properties.
The action will be looked up in action groups that are found among
the widgets ancestors. Most commonly, these will be the actions with
the “win.” or “app.” prefix that are associated with the ApplicationWindow
or Application
, but other action groups that are added with
widgetInsertActionGroup
will be consulted as well.
- newtype Actionable = Actionable (ManagedPtr Actionable)
- noActionable :: Maybe Actionable
- class GObject o => IsActionable o
- toActionable :: IsActionable o => o -> IO Actionable
- data ActionableGetActionNameMethodInfo
- actionableGetActionName :: (HasCallStack, MonadIO m, IsActionable a) => a -> m (Maybe Text)
- data ActionableGetActionTargetValueMethodInfo
- actionableGetActionTargetValue :: (HasCallStack, MonadIO m, IsActionable a) => a -> m GVariant
- data ActionableSetActionNameMethodInfo
- actionableSetActionName :: (HasCallStack, MonadIO m, IsActionable a) => a -> Maybe Text -> m ()
- data ActionableSetActionTargetValueMethodInfo
- actionableSetActionTargetValue :: (HasCallStack, MonadIO m, IsActionable a) => a -> GVariant -> m ()
- data ActionableSetDetailedActionNameMethodInfo
- actionableSetDetailedActionName :: (HasCallStack, MonadIO m, IsActionable a) => a -> Text -> m ()
- data ActionableActionNamePropertyInfo
- actionableActionName :: AttrLabelProxy "actionName"
- clearActionableActionName :: (MonadIO m, IsActionable o) => o -> m ()
- constructActionableActionName :: IsActionable o => Text -> IO (GValueConstruct o)
- getActionableActionName :: (MonadIO m, IsActionable o) => o -> m (Maybe Text)
- setActionableActionName :: (MonadIO m, IsActionable o) => o -> Text -> m ()
- data ActionableActionTargetPropertyInfo
- actionableActionTarget :: AttrLabelProxy "actionTarget"
- clearActionableActionTarget :: (MonadIO m, IsActionable o) => o -> m ()
- constructActionableActionTarget :: IsActionable o => GVariant -> IO (GValueConstruct o)
- getActionableActionTarget :: (MonadIO m, IsActionable o) => o -> m (Maybe GVariant)
- setActionableActionTarget :: (MonadIO m, IsActionable o) => o -> GVariant -> m ()
Exported types
newtype Actionable Source #
GObject Actionable Source # | |
IsObject Actionable Source # | |
IsWidget Actionable Source # | |
IsActionable Actionable Source # | |
((~) * info (ResolveActionableMethod t Actionable), MethodInfo * info Actionable p) => IsLabel t (Actionable -> p) Source # | |
((~) * info (ResolveActionableMethod t Actionable), MethodInfo * info Actionable p) => IsLabelProxy t (Actionable -> p) Source # | |
HasAttributeList * Actionable Source # | |
type AttributeList Actionable Source # | |
type SignalList Actionable Source # | |
class GObject o => IsActionable o Source #
toActionable :: IsActionable o => o -> IO Actionable Source #
Methods
getActionName
data ActionableGetActionNameMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsActionable a) => MethodInfo * ActionableGetActionNameMethodInfo a signature Source # | |
actionableGetActionName Source #
:: (HasCallStack, MonadIO m, IsActionable a) | |
=> a |
|
-> m (Maybe Text) | Returns: the action name, or |
getActionTargetValue
data ActionableGetActionTargetValueMethodInfo Source #
((~) * signature (m GVariant), MonadIO m, IsActionable a) => MethodInfo * ActionableGetActionTargetValueMethodInfo a signature Source # | |
actionableGetActionTargetValue Source #
:: (HasCallStack, MonadIO m, IsActionable a) | |
=> a |
|
-> m GVariant | Returns: the current target value |
Gets the current target value of actionable
.
See actionableSetActionTargetValue
for more information.
Since: 3.4
setActionName
data ActionableSetActionNameMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsActionable a) => MethodInfo * ActionableSetActionNameMethodInfo a signature Source # | |
actionableSetActionName Source #
:: (HasCallStack, MonadIO m, IsActionable a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Specifies the name of the action with which this widget should be
associated. If actionName
is Nothing
then the widget will be
unassociated from any previous action.
Usually this function is used when the widget is located (or will be
located) within the hierarchy of a ApplicationWindow
.
Names are of the form “win.save” or “app.quit” for actions on the
containing ApplicationWindow
or its associated Application
,
respectively. This is the same form used for actions in the Menu
associated with the window.
Since: 3.4
setActionTargetValue
data ActionableSetActionTargetValueMethodInfo Source #
((~) * signature (GVariant -> m ()), MonadIO m, IsActionable a) => MethodInfo * ActionableSetActionTargetValueMethodInfo a signature Source # | |
actionableSetActionTargetValue Source #
:: (HasCallStack, MonadIO m, IsActionable a) | |
=> a |
|
-> GVariant |
|
-> m () |
Sets the target value of an actionable widget.
If targetValue
is Nothing
then the target value is unset.
The target value has two purposes. First, it is used as the
parameter to activation of the action associated with the
Actionable
widget. Second, it is used to determine if the widget
should be rendered as “active” — the widget is active if the state
is equal to the given target.
Consider the example of associating a set of buttons with a Action
with string state in a typical “radio button” situation. Each button
will be associated with the same action, but with a different target
value for that action. Clicking on a particular button will activate
the action with the target of that button, which will typically cause
the action’s state to change to that value. Since the action’s state
is now equal to the target value of the button, the button will now
be rendered as active (and the other buttons, with different targets,
rendered inactive).
Since: 3.4
setDetailedActionName
data ActionableSetDetailedActionNameMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsActionable a) => MethodInfo * ActionableSetDetailedActionNameMethodInfo a signature Source # | |
actionableSetDetailedActionName Source #
:: (HasCallStack, MonadIO m, IsActionable a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the action-name and associated string target value of an actionable widget.
This allows for the effect of both actionableSetActionName
and actionableSetActionTargetValue
in the common case that
the target is string-valued.
detailedActionName
is a string of the form
"action::target"
where action
is the action name and target
is the string to use
as the target.
Since: 3.4
Properties
actionName
data ActionableActionNamePropertyInfo Source #
actionableActionName :: AttrLabelProxy "actionName" Source #
clearActionableActionName :: (MonadIO m, IsActionable o) => o -> m () Source #
constructActionableActionName :: IsActionable o => Text -> IO (GValueConstruct o) Source #
getActionableActionName :: (MonadIO m, IsActionable o) => o -> m (Maybe Text) Source #
setActionableActionName :: (MonadIO m, IsActionable o) => o -> Text -> m () Source #
actionTarget
data ActionableActionTargetPropertyInfo Source #
actionableActionTarget :: AttrLabelProxy "actionTarget" Source #
clearActionableActionTarget :: (MonadIO m, IsActionable o) => o -> m () Source #
constructActionableActionTarget :: IsActionable o => GVariant -> IO (GValueConstruct o) Source #
getActionableActionTarget :: (MonadIO m, IsActionable o) => o -> m (Maybe GVariant) Source #
setActionableActionTarget :: (MonadIO m, IsActionable o) => o -> GVariant -> m () Source #