![]() |
![]() |
![]() |
GTK+ 3 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gtk/gtk.h> GtkRadioAction; GtkRadioAction * gtk_radio_action_new (const gchar *name
,const gchar *label
,const gchar *tooltip
,const gchar *stock_id
,gint value
); GSList * gtk_radio_action_get_group (GtkRadioAction *action
); void gtk_radio_action_set_group (GtkRadioAction *action
,GSList *group
); void gtk_radio_action_join_group (GtkRadioAction *action
,GtkRadioAction *group_source
); gint gtk_radio_action_get_current_value (GtkRadioAction *action
); void gtk_radio_action_set_current_value (GtkRadioAction *action
,gint current_value
);
A GtkRadioAction is similar to GtkRadioMenuItem. A number of radio actions can be linked together so that only one may be active at any one time.
GtkRadioAction * gtk_radio_action_new (const gchar *name
,const gchar *label
,const gchar *tooltip
,const gchar *stock_id
,gint value
);
Creates a new GtkRadioAction object. To add the action to
a GtkActionGroup and set the accelerator for the action,
call gtk_action_group_add_action_with_accel()
.
|
A unique name for the action |
|
The label displayed in menu items and on buttons,
or NULL . [allow-none]
|
|
A tooltip for this action, or NULL . [allow-none]
|
|
The stock icon to display in widgets representing
this action, or NULL . [allow-none]
|
|
The value which gtk_radio_action_get_current_value() should
return if this action is selected.
|
Returns : |
a new GtkRadioAction |
Since 2.4
GSList * gtk_radio_action_get_group (GtkRadioAction *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; 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); } |
|
the action object |
Returns : |
the list representing the radio group for this object. [element-type GtkRadioAction][transfer none GtkRadioAction] |
Since 2.4
void gtk_radio_action_set_group (GtkRadioAction *action
,GSList *group
);
Sets the radio group for the radio action object.
|
the action object |
|
a list representing a radio group. [element-type GtkRadioAction] |
Since 2.4
void gtk_radio_action_join_group (GtkRadioAction *action
,GtkRadioAction *group_source
);
Joins a radio action object to the group of another radio action object.
Use this in language bindings instead of the gtk_radio_action_get_group()
and gtk_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 |
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; } |
|
the action object |
|
a radio action object whos group we are
joining, or NULL to remove the radio action from its group. [allow-none]
|
Since 3.0
gint gtk_radio_action_get_current_value (GtkRadioAction *action
);
Obtains the value property of the currently active member of
the group to which action
belongs.
|
a GtkRadioAction |
Returns : |
The value of the currently active group member |
Since 2.4
void gtk_radio_action_set_current_value (GtkRadioAction *action
,gint current_value
);
Sets the currently active group member to the member with value
property current_value
.
|
a GtkRadioAction |
|
the new value |
Since 2.10