| Top |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBin
╰── CtkMenuItem
╰── CtkCheckMenuItem
╰── CtkRadioMenuItem
CtkRadioMenuItem implements AtkImplementorIface, CtkBuildable, CtkActivatable and CtkActionable.
A radio menu item is a check menu item that belongs to a group. At each instant exactly one of the radio menu items from a group is selected.
The group list does not need to be freed, as each CtkRadioMenuItem will remove itself and its list item when it is destroyed.
The correct way to create a group of radio menu items is approximatively this:
1 2 3 4 5 6 7 8 9 10 11 |
GSList *group = NULL; CtkWidget *item; gint i; for (i = 0; i < 5; i++) { item = ctk_radio_menu_item_new_with_label (group, "This is an example"); group = ctk_radio_menu_item_get_group (CTK_RADIO_MENU_ITEM (item)); if (i == 1) ctk_check_menu_item_set_active (CTK_CHECK_MENU_ITEM (item), TRUE); } |
CtkWidget *
ctk_radio_menu_item_new (GSList *group);
Creates a new CtkRadioMenuItem.
CtkWidget * ctk_radio_menu_item_new_with_label (GSList *group,const gchar *label);
Creates a new CtkRadioMenuItem whose child is a simple CtkLabel.
CtkWidget * ctk_radio_menu_item_new_with_mnemonic (GSList *group,const gchar *label);
Creates a new CtkRadioMenuItem containing a label. The label
will be created using ctk_label_new_with_mnemonic(), so underscores
in label
indicate the mnemonic for the menu item.
CtkWidget *
ctk_radio_menu_item_new_from_widget (CtkRadioMenuItem *group);
Creates a new CtkRadioMenuItem adding it to the same group as group
.
[constructor]
Since: 2.4
CtkWidget * ctk_radio_menu_item_new_with_label_from_widget (CtkRadioMenuItem *group,const gchar *label);
Creates a new CtkRadioMenuItem whose child is a simple CtkLabel.
The new CtkRadioMenuItem is added to the same group as group
.
[constructor]
group |
an existing CtkRadioMenuItem. |
[allow-none] |
label |
the text for the label. |
[allow-none] |
Since: 2.4
CtkWidget * ctk_radio_menu_item_new_with_mnemonic_from_widget (CtkRadioMenuItem *group,const gchar *label);
Creates a new CtkRadioMenuItem containing a label. The label will be
created using ctk_label_new_with_mnemonic(), so underscores in label
indicate the mnemonic for the menu item.
The new CtkRadioMenuItem is added to the same group as group
.
[constructor]
group |
An existing CtkRadioMenuItem. |
[allow-none] |
label |
the text of the button, with an underscore in front of the mnemonic character. |
[allow-none] |
Since: 2.4
void ctk_radio_menu_item_set_group (CtkRadioMenuItem *radio_menu_item,GSList *group);
Sets the group of a radio menu item, or changes it.
GSList *
ctk_radio_menu_item_get_group (CtkRadioMenuItem *radio_menu_item);
Returns the group to which the radio menu item belongs, as a GList of CtkRadioMenuItem. The list belongs to CTK+ and should not be freed.
void ctk_radio_menu_item_join_group (CtkRadioMenuItem *radio_menu_item,CtkRadioMenuItem *group_source);
Joins a CtkRadioMenuItem object to the group of another CtkRadioMenuItem object.
This function should be used by language bindings to avoid the memory
manangement of the opaque GSList of ctk_radio_menu_item_get_group()
and ctk_radio_menu_item_set_group().
A common way to set up a group of CtkRadioMenuItem instances is:
1 2 3 4 5 6 7 8 9 10 11 |
CtkRadioMenuItem *last_item = NULL; while ( ...more items to add... ) { CtkRadioMenuItem *radio_item; radio_item = ctk_radio_menu_item_new (...); ctk_radio_menu_item_join_group (radio_item, last_item); last_item = radio_item; } |
radio_menu_item |
||
group_source |
a CtkRadioMenuItem whose group we are
joining, or |
[allow-none] |
Since: 3.18
“group” property“group” CtkRadioMenuItem *
The radio menu item whose group this widget belongs to.
Owner: CtkRadioMenuItem
Flags: Write
Since: 2.8
“group-changed” signalvoid user_function (CtkRadioMenuItem *ctkradiomenuitem, gpointer user_data)
Flags: Run First