| Top |
| CtkRadioAction * | ctk_radio_action_new () |
| GSList * | ctk_radio_action_get_group () |
| void | ctk_radio_action_set_group () |
| void | ctk_radio_action_join_group () |
| gint | ctk_radio_action_get_current_value () |
| void | ctk_radio_action_set_current_value () |
A CtkRadioAction is similar to CtkRadioMenuItem. A number of radio actions can be linked together so that only one may be active at any one time.
CtkRadioAction * ctk_radio_action_new (const gchar *name,const gchar *label,const gchar *tooltip,const gchar *stock_id,gint value);
Creates a new CtkRadioAction object. To add the action to
a CtkActionGroup and set the accelerator for the action,
call ctk_action_group_add_action_with_accel().
name |
A unique name for the action |
|
label |
The label displayed in menu items and on buttons,
or |
[allow-none] |
tooltip |
A tooltip for this action, or |
[allow-none] |
stock_id |
The stock icon to display in widgets representing
this action, or |
[allow-none] |
value |
The value which |
Since: 2.4
GSList *
ctk_radio_action_get_group (CtkRadioAction *action);
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:
1 2 3 4 5 6 7 8 9 10 |
GSList *group = NULL; CtkRadioAction *action; while ( ...more actions to add... /) { action = ctk_radio_action_new (...); ctk_radio_action_set_group (action, group); group = ctk_radio_action_get_group (action); } |
the list representing the radio group for this object.
[element-type CtkRadioAction][transfer none]
Since: 2.4
void ctk_radio_action_set_group (CtkRadioAction *action,GSList *group);
Sets the radio group for the radio action object.
action |
the action object |
|
group |
a list representing a radio group, or |
[element-type CtkRadioAction][allow-none] |
Since: 2.4
void ctk_radio_action_join_group (CtkRadioAction *action,CtkRadioAction *group_source);
Joins a radio action object to the group of another radio action object.
Use this in language bindings instead of the ctk_radio_action_get_group()
and ctk_radio_action_set_group() methods
A common way to set up a group of radio actions is the following:
1 2 3 4 5 6 7 8 9 10 |
CtkRadioAction *action; CtkRadioAction *last_action; while ( ...more actions to add... /) { action = ctk_radio_action_new (...); ctk_radio_action_join_group (action, last_action); last_action = action; } |
action |
the action object |
|
group_source |
a radio action object whos group we are
joining, or |
[allow-none] |
Since: 3.0
gint
ctk_radio_action_get_current_value (CtkRadioAction *action);
Obtains the value property of the currently active member of
the group to which action
belongs.
Since: 2.4
void ctk_radio_action_set_current_value (CtkRadioAction *action,gint current_value);
Sets the currently active group member to the member with value
property current_value
.
Since: 2.10
“current-value” property “current-value” int
The value property of the currently active member of the group to which this action belongs.
Owner: CtkRadioAction
Flags: Read / Write
Default value: 0
Since: 2.10
“group” property“group” CtkRadioAction *
Sets a new group for a radio action.
Owner: CtkRadioAction
Flags: Write
Since: 2.4
“value” property “value” int
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 ctk_radio_action_get_current_value() and CtkRadioActionEntry
for convenient ways to get and set this property.
Owner: CtkRadioAction
Flags: Read / Write
Default value: 0
Since: 2.4
“changed” signalvoid user_function (CtkRadioAction *action, CtkRadioAction *current, gpointer user_data)
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.
action |
the action on which the signal is emitted |
|
current |
the member of |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Recursion
Since: 2.4