RadioMenuItem

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 #GtkRadioMenuItem 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>

GtkRadioMenuItem has a main CSS node with name menuitem, and a subnode with name radio, which gets the .left or .right style class.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(gtk.radio_menu_item.RadioMenuItem[] group)

Creates a new #GtkRadioMenuItem.

Members

Functions

connectGroupChanged
gulong connectGroupChanged(T callback, Flag!"After" after)

Connect to GroupChanged signal.

getGroup
gtk.radio_menu_item.RadioMenuItem[] getGroup()

Returns the group to which the radio menu item belongs, as a #GList of #GtkRadioMenuItem. The list belongs to GTK+ and should not be freed.

joinGroup
void joinGroup(gtk.radio_menu_item.RadioMenuItem groupSource)

Joins a #GtkRadioMenuItem object to the group of another #GtkRadioMenuItem object.

self
RadioMenuItem self()

Returns this, for use in with statements.

setGroup
void setGroup(gtk.radio_menu_item.RadioMenuItem[] group)

Sets the group of a radio menu item, or changes it.

Properties

_gType
GType _gType [@property getter]
group
gtk.radio_menu_item.RadioMenuItem group [@property setter]

Set group property.

Static functions

_getGType
GType _getGType()
builder
RadioMenuItemGidBuilder builder()

Get builder for gtk.radio_menu_item.RadioMenuItem

newFromWidget
gtk.radio_menu_item.RadioMenuItem newFromWidget(gtk.radio_menu_item.RadioMenuItem group)

Creates a new #GtkRadioMenuItem adding it to the same group as group.

newWithLabel
gtk.radio_menu_item.RadioMenuItem newWithLabel(gtk.radio_menu_item.RadioMenuItem[] group, string label)

Creates a new #GtkRadioMenuItem whose child is a simple #GtkLabel.

newWithLabelFromWidget
gtk.radio_menu_item.RadioMenuItem newWithLabelFromWidget(gtk.radio_menu_item.RadioMenuItem group, string label)

Creates a new GtkRadioMenuItem whose child is a simple GtkLabel. The new #GtkRadioMenuItem is added to the same group as group.

newWithMnemonic
gtk.radio_menu_item.RadioMenuItem newWithMnemonic(gtk.radio_menu_item.RadioMenuItem[] group, string label)

Creates a new #GtkRadioMenuItem containing a label. The label will be created using gtk.label.Label.newWithMnemonic, so underscores in label indicate the mnemonic for the menu item.

newWithMnemonicFromWidget
gtk.radio_menu_item.RadioMenuItem newWithMnemonicFromWidget(gtk.radio_menu_item.RadioMenuItem group, string label)

Creates a new GtkRadioMenuItem containing a label. The label will be created using gtk.label.Label.newWithMnemonic, so underscores in label indicate the mnemonic for the menu item.

Inherited Members

From CheckMenuItem

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
CheckMenuItem self()

Returns this, for use in with statements.

builder
CheckMenuItemGidBuilder builder()

Get builder for gtk.check_menu_item.CheckMenuItem

active
bool active [@property getter]
active
bool active [@property setter]
drawAsRadio
bool drawAsRadio [@property getter]
drawAsRadio
bool drawAsRadio [@property setter]
inconsistent
bool inconsistent [@property getter]
inconsistent
bool inconsistent [@property setter]
newWithLabel
gtk.check_menu_item.CheckMenuItem newWithLabel(string label)

Creates a new #GtkCheckMenuItem with a label.

newWithMnemonic
gtk.check_menu_item.CheckMenuItem newWithMnemonic(string label)

Creates a new #GtkCheckMenuItem containing a label. The label will be created using gtk.label.Label.newWithMnemonic, so underscores in label indicate the mnemonic for the menu item.

getActive
bool getActive()

Returns whether the check menu item is active. See gtk_check_menu_item_set_active ().

getDrawAsRadio
bool getDrawAsRadio()

Returns whether check_menu_item looks like a #GtkRadioMenuItem

getInconsistent
bool getInconsistent()

Retrieves the value set by gtk.check_menu_item.CheckMenuItem.setInconsistent.

setActive
void setActive(bool isActive)

Sets the active state of the menu item’s check box.

setDrawAsRadio
void setDrawAsRadio(bool drawAsRadio)

Sets whether check_menu_item is drawn like a #GtkRadioMenuItem

setInconsistent
void setInconsistent(bool setting)

If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a boolean setting, and the current values in that range are inconsistent, you may want to display the check in an “in between” state. This function turns on “in between” display. Normally you would turn off the inconsistent state again if the user explicitly selects a setting. This has to be done manually, gtk.check_menu_item.CheckMenuItem.setInconsistent only affects visual appearance, it doesn’t affect the semantics of the widget.

toggled
void toggled()

Emits the #GtkCheckMenuItem::toggled signal.

connectToggled
gulong connectToggled(T callback, Flag!"After" after)

Connect to Toggled signal.