Gtk.RadioMenuItem¶
| Subclasses: | None | 
|---|
Methods¶
| class | new(group) | 
| class | new_from_widget(group) | 
| class | new_with_label(group, label) | 
| class | new_with_label_from_widget(group, label) | 
| class | new_with_mnemonic(group, label) | 
| class | new_with_mnemonic_from_widget(group, label) | 
| get_group() | |
| join_group(group_source) | |
| set_group(group) | 
Virtual Methods¶
| Inherited: | Gtk.CheckMenuItem (2), Gtk.MenuItem (8), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2) | 
|---|
| do_group_changed() | 
Properties¶
| Inherited: | Gtk.CheckMenuItem (3), Gtk.MenuItem (5), Gtk.Container (3), Gtk.Widget (39), Gtk.Actionable (2), Gtk.Activatable (2) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| group | Gtk.RadioMenuItem | w | The radio menu item whose group this widget belongs to. | 
Style Properties¶
| Inherited: | Gtk.CheckMenuItem (1), Gtk.MenuItem (6), Gtk.Widget (17) | 
|---|
Signals¶
| Inherited: | Gtk.CheckMenuItem (1), Gtk.MenuItem (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| group-changed | 
Fields¶
| Inherited: | Gtk.CheckMenuItem (1), Gtk.MenuItem (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| check_menu_item | Gtk.CheckMenuItem | r | 
Class Details¶
- 
class Gtk.RadioMenuItem(*args, **kwargs)¶
- Bases: - Gtk.CheckMenuItem- Abstract: - No - Structure: - Gtk.RadioMenuItemClass- 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 - Gtk.RadioMenuItemwill remove itself and its list item when it is destroyed.- The correct way to create a group of radio menu items is approximatively this: - How to create a group of radio menu items.
 - GSList *group = NULL; GtkWidget *item; gint i; for (i = 0; i < 5; i++) { item = gtk_radio_menu_item_new_with_label (group, "This is an example"); group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); if (i == 1) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); } - CSS nodes
 - menuitem ├── radio.left ╰── <child> - Gtk.RadioMenuItemhas a main CSS node with name menuitem, and a subnode with name radio, which gets the .left or .right style class.- 
classmethod new(group)[source]¶
- Parameters: - group ([ - Gtk.RadioMenuItem] or- None) – the group to which the radio menu item is to be attached, or- None- Returns: - a new - Gtk.RadioMenuItem- Return type: - Gtk.Widget- Creates a new - Gtk.RadioMenuItem.
 - 
classmethod new_from_widget(group)[source]¶
- Parameters: - group ( - Gtk.RadioMenuItemor- None) – An existing- Gtk.RadioMenuItem- Returns: - The new - Gtk.RadioMenuItem- Return type: - Gtk.Widget- Creates a new - Gtk.RadioMenuItemadding it to the same group as group.- New in version 2.4. 
 - 
classmethod new_with_label(group, label)[source]¶
- Parameters: - group ([Gtk.RadioMenuItem] orNone) – group the radio menu item is inside, orNone
- label (str) – the text for the label
 - Returns: - A new - Gtk.RadioMenuItem- Return type: - Creates a new - Gtk.RadioMenuItemwhose child is a simple- Gtk.Label.
- group ([
 - 
classmethod new_with_label_from_widget(group, label)[source]¶
- Parameters: - group (Gtk.RadioMenuItemorNone) – an existingGtk.RadioMenuItem
- label (strorNone) – the text for the label
 - Returns: - The new - Gtk.RadioMenuItem- Return type: - Creates a new - Gtk.RadioMenuItemwhose child is a simple- Gtk.Label. The new- Gtk.RadioMenuItemis added to the same group as group.- New in version 2.4. 
- group (
 - 
classmethod new_with_mnemonic(group, label)[source]¶
- Parameters: - group ([Gtk.RadioMenuItem] orNone) – group the radio menu item is inside, orNone
- label (str) – the text of the button, with an underscore in front of the mnemonic character
 - Returns: - a new - Gtk.RadioMenuItem- Return type: - Creates a new - Gtk.RadioMenuItemcontaining a label. The label will be created using- Gtk.Label.new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.
- group ([
 - 
classmethod new_with_mnemonic_from_widget(group, label)[source]¶
- Parameters: - group (Gtk.RadioMenuItemorNone) – An existingGtk.RadioMenuItem
- label (strorNone) – the text of the button, with an underscore in front of the mnemonic character
 - Returns: - The new - Gtk.RadioMenuItem- Return type: - Creates a new - Gtk.RadioMenuItemcontaining a label. The label will be created using- Gtk.Label.new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.- The new - Gtk.RadioMenuItemis added to the same group as group.- New in version 2.4. 
- group (
 - 
get_group()[source]¶
- Returns: - the group of self - Return type: - [ - Gtk.RadioMenuItem]- Returns the group to which the radio menu item belongs, as a - GLib.Listof- Gtk.RadioMenuItem. The list belongs to GTK+ and should not be freed.
 - 
join_group(group_source)[source]¶
- Parameters: - group_source ( - Gtk.RadioMenuItemor- None) – a- Gtk.RadioMenuItemwhose group we are joining, or- Noneto remove the self from its current group- Joins a - Gtk.RadioMenuItemobject to the group of another- Gtk.RadioMenuItemobject.- This function should be used by language bindings to avoid the memory manangement of the opaque - GLib.SListof- Gtk.RadioMenuItem.get_group() and- Gtk.RadioMenuItem.set_group().- A common way to set up a group of - Gtk.RadioMenuIteminstances is:- GtkRadioMenuItem *last_item = NULL; while ( ...more items to add... ) { GtkRadioMenuItem *radio_item; radio_item = gtk_radio_menu_item_new (...); gtk_radio_menu_item_join_group (radio_item, last_item); last_item = radio_item; }- New in version 3.18. 
 - 
set_group(group)[source]¶
- Parameters: - group ([ - Gtk.RadioMenuItem] or- None) – the new group, or- None.- Sets the group of a radio menu item, or changes it. 
 - 
do_group_changed() virtual¶
 
Signal Details¶
- 
Gtk.RadioMenuItem.signals.group_changed(radio_menu_item)¶
- Signal Name: - group-changed- Flags: - RUN_FIRST- Parameters: - radio_menu_item ( - Gtk.RadioMenuItem) – The object which received the signal
Property Details¶
- 
Gtk.RadioMenuItem.props.group¶
- Name: - group- Type: - Gtk.RadioMenuItem- Default Value: - None- Flags: - WRITABLE- The radio menu item whose group this widget belongs to. - New in version 2.8.