RadioMenuItem

open class RadioMenuItem : CheckMenuItem, RadioMenuItemProtocol

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.

(C Language Example):

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

(plain Language Example):

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.

The RadioMenuItem type acts as a reference-counted owner of an underlying GtkRadioMenuItem instance. It provides the methods that can operate on this data type through RadioMenuItemProtocol conformance. Use RadioMenuItem as a strong reference or owner of a GtkRadioMenuItem instance.

  • Constructor for creating a RadioMenuItem with a text label, creating a new group.

    Declaration

    Swift

    @inlinable
    public override init(label: UnsafePointer<gchar>!)

    Parameters

    label

    the label to use for the button

  • Constructor for creating a RadioMenuItem with a text label that contains menomics and creates a new group. Underscores in label indicate the mnemonic for the button.

    Declaration

    Swift

    @inlinable
    public override init(mnemonic label: UnsafePointer<gchar>!)

    Parameters

    label

    the label (including mnemonic) to use for the button

  • Designated initialiser from the underlying `C` data type.
    

    This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<GtkRadioMenuItem>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<GtkRadioMenuItem>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    override public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    override public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<GtkRadioMenuItem>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<GtkRadioMenuItem>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. Will retain GtkRadioMenuItem. i.e., ownership is transferred to the RadioMenuItem instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<GtkRadioMenuItem>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements RadioMenuItemProtocol Will retain GtkRadioMenuItem.

    Declaration

    Swift

    @inlinable
    public init<T>(radioMenuItem other: T) where T : RadioMenuItemProtocol

    Parameters

    other

    an instance of a related type that implements RadioMenuItemProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    override public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    required public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    override public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to RadioMenuItemProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new GtkRadioMenuItem.

    Declaration

    Swift

    @inlinable
    public init<SListT>(group: SListT?) where SListT : SListProtocol
  • Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.

    Declaration

    Swift

    @inlinable
    public init<SListT>(group: SListT?, label: UnsafePointer<gchar>!) where SListT : SListProtocol
  • Creates a new GtkRadioMenuItem containing a label. The label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.

    Declaration

    Swift

    @inlinable
    public init<SListT>(group: SListT?, mnemonic label: UnsafePointer<gchar>!) where SListT : SListProtocol
  • Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.

    Declaration

    Swift

    @inlinable
    public static func newWith<SListT>(group: SListT?, label: UnsafePointer<gchar>!) -> Widget! where SListT : SListProtocol
  • Creates a new GtkRadioMenuItem containing a label. The label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.

    Declaration

    Swift

    @inlinable
    public static func newWith<SListT>(group: SListT?, mnemonic label: UnsafePointer<gchar>!) -> Widget! where SListT : SListProtocol