<refentry id="GtkRadioMenuItem">
<refmeta>
<refentrytitle>GtkRadioMenuItem</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkRadioMenuItem</refname><refpurpose>A choice from multiple check menu items.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gtk/gtk.h&gt;


struct      <link linkend="GtkRadioMenuItem-struct">GtkRadioMenuItem</link>;
<link linkend="GtkWidget">GtkWidget</link>*  <link linkend="gtk-radio-menu-item-new">gtk_radio_menu_item_new</link>         (<link linkend="GSList">GSList</link> *group);
<link linkend="GtkWidget">GtkWidget</link>*  <link linkend="gtk-radio-menu-item-new-with-label">gtk_radio_menu_item_new_with_label</link>
                                            (<link linkend="GSList">GSList</link> *group,
                                             const <link linkend="gchar">gchar</link> *label);
<link linkend="GtkWidget">GtkWidget</link>*  <link linkend="gtk-radio-menu-item-new-with-mnemonic">gtk_radio_menu_item_new_with_mnemonic</link>
                                            (<link linkend="GSList">GSList</link> *group,
                                             const <link linkend="gchar">gchar</link> *label);
#define     <link linkend="gtk-radio-menu-item-group">gtk_radio_menu_item_group</link>
void        <link linkend="gtk-radio-menu-item-set-group">gtk_radio_menu_item_set_group</link>   (<link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link> *radio_menu_item,
                                             <link linkend="GSList">GSList</link> *group);
<link linkend="GSList">GSList</link>*     <link linkend="gtk-radio-menu-item-get-group">gtk_radio_menu_item_get_group</link>   (<link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link> *radio_menu_item);


</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</link>
   +----<link linkend="GtkObject">GtkObject</link>
         +----<link linkend="GtkWidget">GtkWidget</link>
               +----<link linkend="GtkContainer">GtkContainer</link>
                     +----<link linkend="GtkBin">GtkBin</link>
                           +----<link linkend="GtkItem">GtkItem</link>
                                 +----<link linkend="GtkMenuItem">GtkMenuItem</link>
                                       +----<link linkend="GtkCheckMenuItem">GtkCheckMenuItem</link>
                                             +----GtkRadioMenuItem
</synopsis>

</refsect1>




<refsect1>
<title>Description</title>
<para>
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.
</para>
<para>
The correct way to create a group of radio menu items is aproximativly
this:
</para>
<example>
<title>How to create a group of radio menu items.</title>
<programlisting>
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_get_group (GTK_RADIO_MENU_ITEM (item));
  if (i == 1)
    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
}
</programlisting>
</example>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GtkRadioMenuItem-struct">struct GtkRadioMenuItem</title>
<programlisting>struct GtkRadioMenuItem;</programlisting>
<para>
The structure contains only private data that must be accessed through
the interface functions.
</para></refsect2>
<refsect2>
<title><anchor id="gtk-radio-menu-item-new">gtk_radio_menu_item_new ()</title>
<programlisting><link linkend="GtkWidget">GtkWidget</link>*  gtk_radio_menu_item_new         (<link linkend="GSList">GSList</link> *group);</programlisting>
<para>
Creates a new <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>group</parameter>&nbsp;:</entry>
<entry>the group to which the radio menu item is to be attached
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a new <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-radio-menu-item-new-with-label">gtk_radio_menu_item_new_with_label ()</title>
<programlisting><link linkend="GtkWidget">GtkWidget</link>*  gtk_radio_menu_item_new_with_label
                                            (<link linkend="GSList">GSList</link> *group,
                                             const <link linkend="gchar">gchar</link> *label);</programlisting>
<para>
Creates a new <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link> whose child is a simple <link linkend="GtkLabel">GtkLabel</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>group</parameter>&nbsp;:</entry>
<entry>the group to which the radio menu item is to be attached
</entry></row>
<row><entry align="right"><parameter>label</parameter>&nbsp;:</entry>
<entry>the text for the label
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a new <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-radio-menu-item-new-with-mnemonic">gtk_radio_menu_item_new_with_mnemonic ()</title>
<programlisting><link linkend="GtkWidget">GtkWidget</link>*  gtk_radio_menu_item_new_with_mnemonic
                                            (<link linkend="GSList">GSList</link> *group,
                                             const <link linkend="gchar">gchar</link> *label);</programlisting>
<para>
Creates a new <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link> containing a label. The label
will be created using <link linkend="gtk-label-new-with-mnemonic">gtk_label_new_with_mnemonic</link>(), so underscores
in <parameter>label</parameter> indicate the mnemonic for the menu item.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>group</parameter>&nbsp;:</entry>
<entry> group the radio menu item is inside
</entry></row>
<row><entry align="right"><parameter>label</parameter>&nbsp;:</entry>
<entry> the text of the button, with an underscore in front of the
        mnemonic character
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-radio-menu-item-group">gtk_radio_menu_item_group</title>
<programlisting>#define gtk_radio_menu_item_group gtk_radio_menu_item_get_group
</programlisting>
<para>
Deprecated compatibility macro. Use <link linkend="gtk-radio-menu-item-get-group">gtk_radio_menu_item_get_group</link>() instead.
</para></refsect2>
<refsect2>
<title><anchor id="gtk-radio-menu-item-set-group">gtk_radio_menu_item_set_group ()</title>
<programlisting>void        gtk_radio_menu_item_set_group   (<link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link> *radio_menu_item,
                                             <link linkend="GSList">GSList</link> *group);</programlisting>
<para>
Sets the group of a radio menu item, or changes it.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>radio_menu_item</parameter>&nbsp;:</entry>
<entry>a <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>.
</entry></row>
<row><entry align="right"><parameter>group</parameter>&nbsp;:</entry>
<entry>the new group.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-radio-menu-item-get-group">gtk_radio_menu_item_get_group ()</title>
<programlisting><link linkend="GSList">GSList</link>*     gtk_radio_menu_item_get_group   (<link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link> *radio_menu_item);</programlisting>
<para>
Returns the group to which the radio menu item belongs, as a <link linkend="GList">GList</link> of
<link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>. The list belongs to GTK+ and should not be freed.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>radio_menu_item</parameter>&nbsp;:</entry>
<entry>a <link linkend="GtkRadioMenuItem">GtkRadioMenuItem</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the group of <parameter>radio_menu_item</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>



<refsect1>
<title>See Also</title>
<para>
<variablelist>
<varlistentry>
<term><link linkend="GtkMenuItem">GtkMenuItem</link></term>
<listitem><para>because a radio menu item is a menu item.</para></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GtkCheckMenuItem">GtkCheckMenuItem</link></term>
<listitem><para>to know how to handle the check.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

</refentry>
