gi-gtk-3.0.27: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.RadioAction

Contents

Description

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

Exported types

newtype RadioAction Source #

Memory-managed wrapper type.

class GObject o => IsRadioAction o Source #

Type class for types which can be safely cast to RadioAction, for instance with toRadioAction.

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

getCurrentValue

radioActionGetCurrentValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsRadioAction a) 
=> a

action: a RadioAction

-> 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

radioActionGetGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsRadioAction a) 
=> a

action: the action object

-> 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

radioActionJoinGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsRadioAction a, IsRadioAction b) 
=> a

action: the action object

-> Maybe b

groupSource: a radio action object whos group we are joining, or Nothing to remove the radio action from its group

-> 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

radioActionNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: A unique name for the action

-> Maybe Text

label: The label displayed in menu items and on buttons, or Nothing

-> Maybe Text

tooltip: A tooltip for this action, or Nothing

-> Maybe Text

stockId: The stock icon to display in widgets representing this action, or Nothing

-> Int32

value: The value which radioActionGetCurrentValue should return if this action is selected.

-> m RadioAction

Returns: a new RadioAction

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 #

Arguments

:: (HasCallStack, MonadIO m, IsRadioAction a) 
=> a

action: a RadioAction

-> Int32

currentValue: the new value

-> m () 

Deprecated: (Since version 3.10)

Sets the currently active group member to the member with value property currentValue.

Since: 2.10

setGroup

radioActionSetGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsRadioAction a, IsRadioAction b) 
=> a

action: the action object

-> [b]

group: a list representing a radio group, or Nothing

-> 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 => Int32 -> IO (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, IsRadioAction a) => a -> IO (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 => Int32 -> IO (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 #

Arguments

 = RadioAction

current: the member of action's group which has just been activated

-> IO () 

Deprecated: (Since version 3.10)

The ::changed signal is emitted on every member of a radio group when the active member is changed. The signal gets emitted after the ::activate signals for the previous and current active members.

Since: 2.4

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

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