<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkRadioButton">
<refmeta>
<refentrytitle role="top_of_page" id="GtkRadioButton.top_of_page">GtkRadioButton</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkRadioButton</refname>
<refpurpose>A choice from multiple check buttons</refpurpose>
</refnamediv>

<refsect1 id="GtkRadioButton.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-new">gtk_radio_button_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-new-from-widget">gtk_radio_button_new_from_widget</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-new-with-label">gtk_radio_button_new_with_label</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-new-with-label-from-widget">gtk_radio_button_new_with_label_from_widget</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-new-with-mnemonic">gtk_radio_button_new_with_mnemonic</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-new-with-mnemonic-from-widget">gtk_radio_button_new_with_mnemonic_from_widget</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-radio-button-set-group">gtk_radio_button_set_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GSList"><returnvalue>GSList</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-radio-button-get-group">gtk_radio_button_get_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-radio-button-join-group">gtk_radio_button_join_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkRadioButton.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkRadioButton--group">group</link></entry><entry role="property_flags">Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkRadioButton.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkRadioButton-group-changed">group-changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-FIRST:CAPS">Run First</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkRadioButton.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkRadioButton-struct">GtkRadioButton</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkRadioButton.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkButton">GtkButton</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkToggleButton">GtkToggleButton</link>
                    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkCheckButton">GtkCheckButton</link>
                        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkRadioButton
</screen>
</refsect1>
<refsect1 id="GtkRadioButton.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkRadioButton implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link>,  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link> and  <link linkend="GtkActionable">GtkActionable</link>.</para>

</refsect1>

<refsect1 id="GtkRadioButton.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkRadioButton.description" role="desc">
<title role="desc.title">Description</title>
<para>A single radio button performs the same basic function as a <link linkend="GtkCheckButton"><type>GtkCheckButton</type></link>,
as its position in the object hierarchy reflects. It is only when multiple
radio buttons are grouped together that they become a different user
interface component in their own right.</para>
<para>Every radio button is a member of some group of radio buttons. When one is
selected, all other radio buttons in the same group are deselected. A
<link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> is one way of giving the user a choice from many options.</para>
<para>Radio button widgets are created with <link linkend="gtk-radio-button-new"><function>gtk_radio_button_new()</function></link>, passing <link linkend="NULL:CAPS"><literal>NULL</literal></link>
as the argument if this is the first radio button in a group. In subsequent
calls, the group you wish to add this button to should be passed as an
argument. Optionally, <link linkend="gtk-radio-button-new-with-label"><function>gtk_radio_button_new_with_label()</function></link> can be used if you
want a text label on the radio button.</para>
<para>Alternatively, when adding widgets to an existing group of radio buttons,
use <link linkend="gtk-radio-button-new-from-widget"><function>gtk_radio_button_new_from_widget()</function></link> with a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> that already
has a group assigned to it. The convenience function
<link linkend="gtk-radio-button-new-with-label-from-widget"><function>gtk_radio_button_new_with_label_from_widget()</function></link> is also provided.</para>
<para>To retrieve the group a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> is assigned to, use
<link linkend="gtk-radio-button-get-group"><function>gtk_radio_button_get_group()</function></link>.</para>
<para>To remove a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> from one group and make it part of a new one,
use <link linkend="gtk-radio-button-set-group"><function>gtk_radio_button_set_group()</function></link>.</para>
<para>The group list does not need to be freed, as each <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> will remove
itself and its list item when it is destroyed.</para>
<refsect2><title>CSS nodes</title><informalexample><programlisting role="example"><![CDATA[
radiobutton
├── radio
╰── <child>
]]></programlisting></informalexample>
<para></para>
<para>A GtkRadioButton with indicator (see <link linkend="gtk-check-button-set-draw-indicator"><function>gtk_check_button_set_draw_indicator()</function></link>)) has a
main CSS node with name radiobutton and a subnode with name radio.</para>
<informalexample><programlisting role="example"><![CDATA[
button.radio
├── radio
╰── <child>
]]></programlisting></informalexample>
<para></para>
<para>A GtkRadioButton without indicator changes the name of its main node
to button and adds a .radio style class to it. The subnode is invisible
in this case.</para>
<refsect3><title>How to create a group of two radio buttons.</title><informalexample><programlisting role="example"><![CDATA[
void create_radio_buttons (void) {

   GtkWidget *window, *radio1, *radio2, *box, *entry;
   window = gtk_window_new ();
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
   gtk_box_set_homogeneous (GTK_BOX (box), TRUE);

   // Create a radio button with a GtkEntry widget
   radio1 = gtk_radio_button_new (NULL);
   entry = gtk_entry_new ();
   gtk_box_append (GTK_BOX (radio1), entry);


   // Create a radio button with a label
   radio2 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio1),
                                                         "I’m the second radio button.");

   // Pack them into a box, then show all the widgets
   gtk_box_append (GTK_BOX (box), radio1);
   gtk_box_append (GTK_BOX (box), radio2);
      gtk_window_set_child (GTK_WINDOW (window),box);
   gtk_widget_show (window);
   return;
}
]]></programlisting></informalexample>
<para></para>
<para>When an unselected button in the group is clicked the clicked button
receives the <link linkend="GtkToggleButton-toggled"><type>“toggled”</type></link> signal, as does the previously
selected button.
Inside the <link linkend="GtkToggleButton-toggled"><type>“toggled”</type></link> handler, <link linkend="gtk-toggle-button-get-active"><function>gtk_toggle_button_get_active()</function></link>
can be used to determine if the button has been selected or deselected.</para>
</refsect3>
</refsect2>

</refsect1>
<refsect1 id="GtkRadioButton.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-radio-button-new" role="function">
<title>gtk_radio_button_new&#160;()</title>
<indexterm zone="gtk-radio-button-new"><primary>gtk_radio_button_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_radio_button_new (<parameter><link linkend="GSList"><type>GSList</type></link> *group</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>. To be of any practical value, a widget should
then be packed into the radio button.</para>
<refsect3 id="gtk-radio-button-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>group</para></entry>
<entry role="parameter_description"><para>an existing
radio button group, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if you are creating a new group. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>element-type</acronym> GtkRadioButton][<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-new.returns" role="returns">
<title>Returns</title>
<para> a new radio button</para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-new-from-widget" role="function">
<title>gtk_radio_button_new_from_widget&#160;()</title>
<indexterm zone="gtk-radio-button-new-from-widget"><primary>gtk_radio_button_new_from_widget</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_radio_button_new_from_widget (<parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *radio_group_member</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>, adding it to the same group as
<parameter>radio_group_member</parameter>
. As with <link linkend="gtk-radio-button-new"><function>gtk_radio_button_new()</function></link>, a widget
should be packed into the radio button.</para>

<para><emphasis role="annotation">[<acronym>constructor</acronym>]</emphasis></para><refsect3 id="gtk-radio-button-new-from-widget.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>radio_group_member</para></entry>
<entry role="parameter_description"><para>an existing <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-new-from-widget.returns" role="returns">
<title>Returns</title>
<para>a new radio button. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-new-with-label" role="function">
<title>gtk_radio_button_new_with_label&#160;()</title>
<indexterm zone="gtk-radio-button-new-with-label"><primary>gtk_radio_button_new_with_label</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_radio_button_new_with_label (<parameter><link linkend="GSList"><type>GSList</type></link> *group</parameter>,
                                 <parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> with a text label.</para>
<refsect3 id="gtk-radio-button-new-with-label.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>group</para></entry>
<entry role="parameter_description"><para>an existing
radio button group, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if you are creating a new group. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>element-type</acronym> GtkRadioButton][<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>label</para></entry>
<entry role="parameter_description"><para>the text label to display next to the radio button.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-new-with-label.returns" role="returns">
<title>Returns</title>
<para> a new radio button.</para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-new-with-label-from-widget" role="function">
<title>gtk_radio_button_new_with_label_from_widget&#160;()</title>
<indexterm zone="gtk-radio-button-new-with-label-from-widget"><primary>gtk_radio_button_new_with_label_from_widget</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_radio_button_new_with_label_from_widget
                               (<parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *radio_group_member</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> with a text label, adding it to
the same group as <parameter>radio_group_member</parameter>
.</para>

<para><emphasis role="annotation">[<acronym>constructor</acronym>]</emphasis></para><refsect3 id="gtk-radio-button-new-with-label-from-widget.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>radio_group_member</para></entry>
<entry role="parameter_description"><para>widget to get radio group from or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>label</para></entry>
<entry role="parameter_description"><para>a text string to display next to the radio button.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-new-with-label-from-widget.returns" role="returns">
<title>Returns</title>
<para>a new radio button. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-new-with-mnemonic" role="function">
<title>gtk_radio_button_new_with_mnemonic&#160;()</title>
<indexterm zone="gtk-radio-button-new-with-mnemonic"><primary>gtk_radio_button_new_with_mnemonic</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_radio_button_new_with_mnemonic (<parameter><link linkend="GSList"><type>GSList</type></link> *group</parameter>,
                                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> containing a label, adding it to the same
group as <parameter>group</parameter>
. The label will be created using
<link linkend="gtk-label-new-with-mnemonic"><function>gtk_label_new_with_mnemonic()</function></link>, so underscores in <parameter>label</parameter>
 indicate the
mnemonic for the button.</para>
<refsect3 id="gtk-radio-button-new-with-mnemonic.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>group</para></entry>
<entry role="parameter_description"><para>the radio button
group, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>element-type</acronym> GtkRadioButton][<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>label</para></entry>
<entry role="parameter_description"><para>the text of the button, with an underscore in front of the
mnemonic character</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-new-with-mnemonic.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-new-with-mnemonic-from-widget" role="function">
<title>gtk_radio_button_new_with_mnemonic_from_widget&#160;()</title>
<indexterm zone="gtk-radio-button-new-with-mnemonic-from-widget"><primary>gtk_radio_button_new_with_mnemonic_from_widget</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_radio_button_new_with_mnemonic_from_widget
                               (<parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *radio_group_member</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *label</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> containing a label. The label
will be created using <link linkend="gtk-label-new-with-mnemonic"><function>gtk_label_new_with_mnemonic()</function></link>, so underscores
in <parameter>label</parameter>
 indicate the mnemonic for the button.</para>

<para><emphasis role="annotation">[<acronym>constructor</acronym>]</emphasis></para><refsect3 id="gtk-radio-button-new-with-mnemonic-from-widget.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>radio_group_member</para></entry>
<entry role="parameter_description"><para>widget to get radio group from or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>label</para></entry>
<entry role="parameter_description"><para>the text of the button, with an underscore in front of the
mnemonic character</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-new-with-mnemonic-from-widget.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-set-group" role="function">
<title>gtk_radio_button_set_group&#160;()</title>
<indexterm zone="gtk-radio-button-set-group"><primary>gtk_radio_button_set_group</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_radio_button_set_group (<parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *radio_button</parameter>,
                            <parameter><link linkend="GSList"><type>GSList</type></link> *group</parameter>);</programlisting>
<para>Sets a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>’s group. It should be noted that this does not change
the layout of your interface in any way, so if you are changing the group,
it is likely you will need to re-arrange the user interface to reflect these
changes.</para>
<refsect3 id="gtk-radio-button-set-group.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>radio_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group</para></entry>
<entry role="parameter_description"><para>an existing radio
button group, such as one returned from <link linkend="gtk-radio-button-get-group"><function>gtk_radio_button_get_group()</function></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>element-type</acronym> GtkRadioButton][<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-get-group" role="function">
<title>gtk_radio_button_get_group&#160;()</title>
<indexterm zone="gtk-radio-button-get-group"><primary>gtk_radio_button_get_group</primary></indexterm>
<programlisting language="C"><link linkend="GSList"><returnvalue>GSList</returnvalue></link>&#160;*
gtk_radio_button_get_group (<parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *radio_button</parameter>);</programlisting>
<para>Retrieves the group assigned to a radio button.</para>
<refsect3 id="gtk-radio-button-get-group.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>radio_button</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-radio-button-get-group.returns" role="returns">
<title>Returns</title>
<para>a linked list
containing all the radio buttons in the same group
as <parameter>radio_button</parameter>
. The returned list is owned by the radio button
and must not be modified or freed. </para>
<para><emphasis role="annotation">[<acronym>element-type</acronym> GtkRadioButton][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-radio-button-join-group" role="function">
<title>gtk_radio_button_join_group&#160;()</title>
<indexterm zone="gtk-radio-button-join-group"><primary>gtk_radio_button_join_group</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_radio_button_join_group (<parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *radio_button</parameter>,
                             <parameter><link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *group_source</parameter>);</programlisting>
<para>Joins a <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> object to the group of another <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> object</para>
<para>Use this in language bindings instead of the <link linkend="gtk-radio-button-get-group"><function>gtk_radio_button_get_group()</function></link> 
and <link linkend="gtk-radio-button-set-group"><function>gtk_radio_button_set_group()</function></link> methods</para>
<para>A common way to set up a group of radio buttons is the following:</para>
<informalexample><programlisting role="example"><![CDATA[
  GtkRadioButton *radio_button;
  GtkRadioButton *last_button;

  while (some_condition)
    {
       radio_button = GTK_RADIO_BUTTON (gtk_radio_button_new (NULL));

       gtk_radio_button_join_group (radio_button, last_button);
       last_button = radio_button;
    }
]]></programlisting></informalexample>
<para></para>
<refsect3 id="gtk-radio-button-join-group.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>radio_button</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> object</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_source</para></entry>
<entry role="parameter_description"><para>a radio button object whos group we are
joining, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to remove the radio button from its group. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkRadioButton.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkRadioButton-struct" role="struct">
<title>GtkRadioButton</title>
<indexterm zone="GtkRadioButton-struct"><primary>GtkRadioButton</primary></indexterm>
<programlisting language="C">typedef struct _GtkRadioButton GtkRadioButton;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkRadioButton.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkRadioButton--group" role="property"><title>The <literal>“group”</literal> property</title>
<indexterm zone="GtkRadioButton--group"><primary>GtkRadioButton:group</primary></indexterm>
<programlisting>  “group”                    <link linkend="GtkRadioButton"><type>GtkRadioButton</type></link>&#160;*</programlisting>
<para>Sets a new group for a radio button.</para>
<para>Owner: GtkRadioButton</para>
<para>Flags: Write</para>
</refsect2>

</refsect1>
<refsect1 id="GtkRadioButton.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkRadioButton-group-changed" role="signal"><title>The <literal>“group-changed”</literal> signal</title>
<indexterm zone="GtkRadioButton-group-changed"><primary>GtkRadioButton::group-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkRadioButton"><type>GtkRadioButton</type></link> *button,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>Emitted when the group of radio buttons that a radio button belongs
to changes. This is emitted when a radio button switches from
being alone to being part of a group of 2 or more buttons, or
vice-versa, and when a button is moved from one group of 2 or
more buttons to a different one, but not when the composition
of the group that a button belongs to changes.</para>
<refsect3 id="GtkRadioButton-group-changed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>button</para></entry>
<entry role="parameter_description"><para>the object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-FIRST:CAPS">Run First</link></para>
</refsect2>
</refsect1>
<refsect1 id="GtkRadioButton.see-also">
<title>See Also</title>
<para><link linkend="GtkComboBox"><type>GtkComboBox</type></link></para>

</refsect1>

</refentry>
