Gtk.RadioMenuItem¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.CheckMenuItem (10), Gtk.MenuItem (20), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Actionable (5), Gtk.Activatable (6)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
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)
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 |
---|---|---|---|
w |
The radio menu item whose group this widget belongs to. |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Gtk.CheckMenuItem (1), Gtk.MenuItem (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Gtk.CheckMenuItem (1), Gtk.MenuItem (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Type |
Access |
Description |
---|---|---|---|
check_menu_item |
r |
Class Details¶
- class Gtk.RadioMenuItem(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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.RadioMenuItem
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:
- 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.RadioMenuItem
has 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
] orNone
) – the group to which the radio menu item is to be attached, orNone
- Returns:
a new
Gtk.RadioMenuItem
- Return type:
Creates a new
Gtk.RadioMenuItem
.
- classmethod new_from_widget(group)[source]¶
- Parameters:
group (
Gtk.RadioMenuItem
orNone
) – An existingGtk.RadioMenuItem
- Returns:
The new
Gtk.RadioMenuItem
- Return type:
Creates a new
Gtk.RadioMenuItem
adding 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.RadioMenuItem
whose child is a simpleGtk.Label
.
- classmethod new_with_label_from_widget(group, label)[source]¶
- Parameters:
group (
Gtk.RadioMenuItem
orNone
) – an existingGtk.RadioMenuItem
- Returns:
The new
Gtk.RadioMenuItem
- Return type:
Creates a new
Gtk.RadioMenuItem
whose child is a simpleGtk.Label
. The newGtk.RadioMenuItem
is added to the same group as group.New in version 2.4.
- 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.RadioMenuItem
containing a label. The label will be created usingGtk.Label.new_with_mnemonic
(), so underscores in label indicate the mnemonic for the menu item.
- classmethod new_with_mnemonic_from_widget(group, label)[source]¶
- Parameters:
group (
Gtk.RadioMenuItem
orNone
) – An existingGtk.RadioMenuItem
label (
str
orNone
) – 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.RadioMenuItem
containing a label. The label will be created usingGtk.Label.new_with_mnemonic
(), so underscores in label indicate the mnemonic for the menu item.The new
Gtk.RadioMenuItem
is added to the same group as group.New in version 2.4.
- get_group()[source]¶
- Returns:
the group of self
- Return type:
Returns the group to which the radio menu item belongs, as a
GLib.List
ofGtk.RadioMenuItem
. The list belongs to GTK+ and should not be freed.
- join_group(group_source)[source]¶
- Parameters:
group_source (
Gtk.RadioMenuItem
orNone
) – aGtk.RadioMenuItem
whose group we are joining, orNone
to remove the self from its current group
Joins a
Gtk.RadioMenuItem
object to the group of anotherGtk.RadioMenuItem
object.This function should be used by language bindings to avoid the memory manangement of the opaque
GLib.SList
ofGtk.RadioMenuItem.get_group
() andGtk.RadioMenuItem.set_group
().A common way to set up a group of
Gtk.RadioMenuItem
instances 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
] orNone
) – the new group, orNone
.
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:
- Parameters:
radio_menu_item (
Gtk.RadioMenuItem
) – The object which received the signal
Property Details¶
- Gtk.RadioMenuItem.props.group¶
- Name:
group
- Type:
- Default Value:
- Flags:
The radio menu item whose group this widget belongs to.
New in version 2.8.