# Gtk::RadioButton Class Reference
Widgets

A single radio button performs the same basic function as a Gtk::CheckButton, as its position in the object hierarchy reflects. More...

Inheritance diagram for Gtk::RadioButton:
[legend]

List of all members.

## Public Types

typedef RadioButtonGroup | Group

## Public Member Functions

virtual | ~RadioButton ()
GtkRadioButton* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkRadioButton* | gobj () const
| Provides access to the underlying C GtkObject.
| RadioButton ()
| RadioButton (const Glib::ustring& label, bool mnemonic=false)
| RadioButton (Group& group)
| Create an empty RadioButton belonging to the specified group, into which you can add() a widget.
| RadioButton (Group& group, const Glib::ustring& label, bool mnemonic=false)
| Create a button belonging to the specified group, with a label inside.
Group | get_group ()
| Get the radio button's group.
void | set_group (Group& group)
| Set the radio button's group.
void | reset_group ()
| Remove the radio button from the group.
void | join_group (RadioButton& group_source)
| Joins a Gtk::RadioButton object to the group of another Gtk::RadioButton object.
Glib::SignalProxy0< void > | signal_group_changed ()

## Protected Member Functions

virtual void | on_group_changed ()

## Related Functions

(Note that these are not member functions.)
Gtk::RadioButton* | wrap (GtkRadioButton* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A single radio button performs the same basic function as a Gtk::CheckButton, 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. 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 Gtk::RadioButton gives the user a choice from many options. After constructing the first RadioButton in a group, use get_group() and provide this Group to the constructors ot the other RadioButtons in the same group. To remove a Gtk::RadioButton from one group and make it part of a new one, use set_group().

The RadioButton widget looks like this:

## Member Typedef Documentation

typedef RadioButtonGroup Gtk::RadioButton::Group

## Constructor & Destructor Documentation

virtual Gtk::RadioButton::~RadioButton | ( |  | ) | `[virtual]`

Gtk::RadioButton::RadioButton | ( |  | ) |

Gtk::RadioButton::RadioButton | ( | const Glib::ustring & | label,
|  | bool | mnemonic = `false`
| ) |  | `[explicit]`

Gtk::RadioButton::RadioButton | ( | Group& | group | ) | `[explicit]`

Create an empty RadioButton belonging to the specified group, into which you can add() a widget.

If you wish to add a Gtk::Label, you may want to use the Gtk::RadioButton(const Group& group, const Glib::ustring& label, bool mnemonic) constructor directly instead.

Gtk::RadioButton::RadioButton | ( | Group& | group,
|  | const Glib::ustring & | label,
|  | bool | mnemonic = `false`
| ) |  |

Create a button belonging to the specified group, with a label inside.

You won't be able to add a widget to this button since it already contains a Gtk::Label.

## Member Function Documentation

Group Gtk::RadioButton::get_group | ( |  | ) |

Get the radio button's group.

This group may be passed to the constructors of other radio buttons, or used with set_group().

Returns:
  The group to which the radio button belongs.

GtkRadioButton* Gtk::RadioButton::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::CheckButton.

const GtkRadioButton* Gtk::RadioButton::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::CheckButton.

void Gtk::RadioButton::join_group | ( | RadioButton& | group_source | ) |

Joins a Gtk::RadioButton object to the group of another Gtk::RadioButton object.

Use this in language bindings instead of the get_group() and set_group() methods

A common way to set up a group of radio buttons is the following:

     GtkRadioButton *radio_button;
     GtkRadioButton *last_button;

     while (/ * more buttons to add * /)
     {
     radio_button = gtk_radio_button_new (...);

     gtk_radio_button_join_group (radio_button, last_button);
     last_button = radio_button;
     }

Since gtkmm 3.0:

Parameters:

  group_source | A radio button object whos group we are joining, or `0` to remove the radio button from its group.

virtual void Gtk::RadioButton::on_group_changed | ( |  | ) | `[protected, virtual]`

void Gtk::RadioButton::reset_group | ( |  | ) |

Remove the radio button from the group.

void Gtk::RadioButton::set_group | ( | Group& | group | ) |

Set the radio button's group.

You can obtain a suitable group from another radio button by using get_group().

Returns:
  The group to which the radio button should belong.

Glib::SignalProxy0< void > Gtk::RadioButton::signal_group_changed | ( |  | ) |

Prototype:
  `void on_my_group_changed()`

## Friends And Related Function Documentation

Gtk::RadioButton* wrap | ( | GtkRadioButton * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/radiobutton.h