GTK+ Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# GtkRadioMenuItem

## Name

GtkRadioMenuItem -- A choice from multiple check menu items.

## Synopsis

    #include <gtk/gtk.h>

    struct      GtkRadioMenuItem;
    GtkWidget*  gtk_radio_menu_item_new         (GSList *group);
    GtkWidget*  gtk_radio_menu_item_new_with_label
                                                (GSList *group,
                                                 const gchar *label);
    GSList*     gtk_radio_menu_item_group       (GtkRadioMenuItem *radio_menu_item);
    void        gtk_radio_menu_item_set_group   (GtkRadioMenuItem *radio_menu_item,
                                                 GSList *group);

## Object Hierarchy

      GtkObject
       +----GtkWidget
             +----GtkContainer
                   +----GtkBin
                         +----GtkItem
                               +----GtkMenuItem
                                     +----GtkCheckMenuItem
                                           +----GtkRadioMenuItem

## Description

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 correct way to create a group of radio menu items is aproximativly this:

Example 1. How to create a group of radio menu items.

    GList *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_group (GTK_RADIO_MENU_ITEM (item));
      if (i == 1)
        gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
    }

## Details

### struct GtkRadioMenuItem

    struct GtkRadioMenuItem;

The structure contains only provate data that must be accessed through the interface functions.

### gtk_radio_menu_item_new ()

    GtkWidget*  gtk_radio_menu_item_new         (GSList *group);

Creates a new GtkRadioMenuItem.

`group` : | the group to wich the radio menu item is to be attached
Returns : | the newly created radio menu item

### gtk_radio_menu_item_new_with_label ()

    GtkWidget*  gtk_radio_menu_item_new_with_label
                                                (GSList *group,
                                                 const gchar *label);

Creates a new GtkRadioMenuItem whose child is a simple GtlLabel.

`group` : | the group to wich the radio menu item is to be attached
`label` : | the text for the label
Returns : | the newly created radio menu item

### gtk_radio_menu_item_group ()

    GSList*     gtk_radio_menu_item_group       (GtkRadioMenuItem *radio_menu_item);

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.

`radio_menu_item` : | the radio menu item
Returns : | its group

### gtk_radio_menu_item_set_group ()

    void        gtk_radio_menu_item_set_group   (GtkRadioMenuItem *radio_menu_item,
                                                 GSList *group);

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

`radio_menu_item` : | the radio menu item
`group` : | the new group

## See Also

GtkMenuItem

  because a radio menu item is a menu item.

GtkCheckItem

  to know how to handle the check.

<<< Previous Page | Home | Up | Next Page >>>
GtkRadioButton | GtkRange