Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A RadioAction
is similar to RadioMenuItem
. A number of radio
actions can be linked together so that only one may be active at any
one time.
Synopsis
- newtype RadioAction = RadioAction (ManagedPtr RadioAction)
- class (GObject o, IsDescendantOf RadioAction o) => IsRadioAction o
- toRadioAction :: (MonadIO m, IsRadioAction o) => o -> m RadioAction
- radioActionGetCurrentValue :: (HasCallStack, MonadIO m, IsRadioAction a) => a -> m Int32
- radioActionGetGroup :: (HasCallStack, MonadIO m, IsRadioAction a) => a -> m [RadioAction]
- radioActionJoinGroup :: (HasCallStack, MonadIO m, IsRadioAction a, IsRadioAction b) => a -> Maybe b -> m ()
- radioActionNew :: (HasCallStack, MonadIO m) => Text -> Maybe Text -> Maybe Text -> Maybe Text -> Int32 -> m RadioAction
- radioActionSetCurrentValue :: (HasCallStack, MonadIO m, IsRadioAction a) => a -> Int32 -> m ()
- radioActionSetGroup :: (HasCallStack, MonadIO m, IsRadioAction a, IsRadioAction b) => a -> [b] -> m ()
- constructRadioActionCurrentValue :: (IsRadioAction o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getRadioActionCurrentValue :: (MonadIO m, IsRadioAction o) => o -> m Int32
- setRadioActionCurrentValue :: (MonadIO m, IsRadioAction o) => o -> Int32 -> m ()
- clearRadioActionGroup :: (MonadIO m, IsRadioAction o) => o -> m ()
- constructRadioActionGroup :: (IsRadioAction o, MonadIO m, IsRadioAction a) => a -> m (GValueConstruct o)
- setRadioActionGroup :: (MonadIO m, IsRadioAction o, IsRadioAction a) => o -> a -> m ()
- constructRadioActionValue :: (IsRadioAction o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getRadioActionValue :: (MonadIO m, IsRadioAction o) => o -> m Int32
- setRadioActionValue :: (MonadIO m, IsRadioAction o) => o -> Int32 -> m ()
- type C_RadioActionChangedCallback = Ptr () -> Ptr RadioAction -> Ptr () -> IO ()
- type RadioActionChangedCallback = RadioAction -> IO ()
- afterRadioActionChanged :: (IsRadioAction a, MonadIO m) => a -> RadioActionChangedCallback -> m SignalHandlerId
- genClosure_RadioActionChanged :: MonadIO m => RadioActionChangedCallback -> m (GClosure C_RadioActionChangedCallback)
- mk_RadioActionChangedCallback :: C_RadioActionChangedCallback -> IO (FunPtr C_RadioActionChangedCallback)
- noRadioActionChangedCallback :: Maybe RadioActionChangedCallback
- onRadioActionChanged :: (IsRadioAction a, MonadIO m) => a -> RadioActionChangedCallback -> m SignalHandlerId
- wrap_RadioActionChangedCallback :: RadioActionChangedCallback -> C_RadioActionChangedCallback
Exported types
newtype RadioAction Source #
Memory-managed wrapper type.
Instances
Eq RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction (==) :: RadioAction -> RadioAction -> Bool # (/=) :: RadioAction -> RadioAction -> Bool # | |
IsGValue RadioAction Source # | Convert |
Defined in GI.Gtk.Objects.RadioAction toGValue :: RadioAction -> IO GValue # fromGValue :: GValue -> IO RadioAction # | |
ManagedPtrNewtype RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction | |
TypedObject RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction | |
GObject RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction | |
HasParentTypes RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction | |
type ParentTypes RadioAction Source # | |
Defined in GI.Gtk.Objects.RadioAction |
class (GObject o, IsDescendantOf RadioAction o) => IsRadioAction o Source #
Type class for types which can be safely cast to RadioAction
, for instance with toRadioAction
.
Instances
(GObject o, IsDescendantOf RadioAction o) => IsRadioAction o Source # | |
Defined in GI.Gtk.Objects.RadioAction |
toRadioAction :: (MonadIO m, IsRadioAction o) => o -> m RadioAction Source #
Cast to RadioAction
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
getCurrentValue
radioActionGetCurrentValue Source #
:: (HasCallStack, MonadIO m, IsRadioAction a) | |
=> a |
|
-> m Int32 | Returns: The value of the currently active group member |
Deprecated: (Since version 3.10)
Obtains the value property of the currently active member of
the group to which action
belongs.
Since: 2.4
getGroup
:: (HasCallStack, MonadIO m, IsRadioAction a) | |
=> a |
|
-> m [RadioAction] | Returns: the list representing the radio group for this object |
Deprecated: (Since version 3.10)
Returns the list representing the radio group for this object. Note that the returned list is only valid until the next change to the group.
A common way to set up a group of radio group is the following:
C code
GSList *group = NULL; GtkRadioAction *action; while ( ...more actions to add... /) { action = gtk_radio_action_new (...); gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); }
Since: 2.4
joinGroup
:: (HasCallStack, MonadIO m, IsRadioAction a, IsRadioAction b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Deprecated: (Since version 3.10)
Joins a radio action object to the group of another radio action object.
Use this in language bindings instead of the radioActionGetGroup
and radioActionSetGroup
methods
A common way to set up a group of radio actions is the following:
C code
GtkRadioAction *action; GtkRadioAction *last_action; while ( ...more actions to add... /) { action = gtk_radio_action_new (...); gtk_radio_action_join_group (action, last_action); last_action = action; }
Since: 3.0
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Int32 |
|
-> m RadioAction | Returns: a new |
Deprecated: (Since version 3.10)
Creates a new RadioAction
object. To add the action to
a ActionGroup
and set the accelerator for the action,
call actionGroupAddActionWithAccel
.
Since: 2.4
setCurrentValue
radioActionSetCurrentValue Source #
:: (HasCallStack, MonadIO m, IsRadioAction a) | |
=> a |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 3.10)
Sets the currently active group member to the member with value
property currentValue
.
Since: 2.10
setGroup
:: (HasCallStack, MonadIO m, IsRadioAction a, IsRadioAction b) | |
=> a |
|
-> [b] |
|
-> m () |
Deprecated: (Since version 3.10)
Sets the radio group for the radio action object.
Since: 2.4
Properties
currentValue
The value property of the currently active member of the group to which this action belongs.
Since: 2.10
constructRadioActionCurrentValue :: (IsRadioAction o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “current-value
” property. This is rarely needed directly, but it is used by new
.
getRadioActionCurrentValue :: (MonadIO m, IsRadioAction o) => o -> m Int32 Source #
Get the value of the “current-value
” property.
When overloading is enabled, this is equivalent to
get
radioAction #currentValue
setRadioActionCurrentValue :: (MonadIO m, IsRadioAction o) => o -> Int32 -> m () Source #
Set the value of the “current-value
” property.
When overloading is enabled, this is equivalent to
set
radioAction [ #currentValue:=
value ]
group
Sets a new group for a radio action.
Since: 2.4
clearRadioActionGroup :: (MonadIO m, IsRadioAction o) => o -> m () Source #
Set the value of the “group
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#group
constructRadioActionGroup :: (IsRadioAction o, MonadIO m, IsRadioAction a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “group
” property. This is rarely needed directly, but it is used by new
.
setRadioActionGroup :: (MonadIO m, IsRadioAction o, IsRadioAction a) => o -> a -> m () Source #
Set the value of the “group
” property.
When overloading is enabled, this is equivalent to
set
radioAction [ #group:=
value ]
value
The value is an arbitrary integer which can be used as a
convenient way to determine which action in the group is
currently active in an activate or changed signal handler.
See radioActionGetCurrentValue
and RadioActionEntry
for convenient ways to get and set this property.
Since: 2.4
constructRadioActionValue :: (IsRadioAction o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “value
” property. This is rarely needed directly, but it is used by new
.
getRadioActionValue :: (MonadIO m, IsRadioAction o) => o -> m Int32 Source #
Get the value of the “value
” property.
When overloading is enabled, this is equivalent to
get
radioAction #value
setRadioActionValue :: (MonadIO m, IsRadioAction o) => o -> Int32 -> m () Source #
Set the value of the “value
” property.
When overloading is enabled, this is equivalent to
set
radioAction [ #value:=
value ]
Signals
changed
type C_RadioActionChangedCallback = Ptr () -> Ptr RadioAction -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type RadioActionChangedCallback Source #
= RadioAction |
|
-> IO () |
afterRadioActionChanged :: (IsRadioAction a, MonadIO m) => a -> RadioActionChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
radioAction #changed callback
genClosure_RadioActionChanged :: MonadIO m => RadioActionChangedCallback -> m (GClosure C_RadioActionChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_RadioActionChangedCallback :: C_RadioActionChangedCallback -> IO (FunPtr C_RadioActionChangedCallback) Source #
Generate a function pointer callable from C code, from a C_RadioActionChangedCallback
.
noRadioActionChangedCallback :: Maybe RadioActionChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
RadioActionChangedCallback
onRadioActionChanged :: (IsRadioAction a, MonadIO m) => a -> RadioActionChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
radioAction #changed callback