Main Page Widgets Namespaces Book

# Gtk::RadioButton Class Reference
[Widgets]

Inheritance diagram for Gtk::RadioButton:

[legend]

List of all members.

## 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:

## Public Types

typedef RadioButtonGroup | Group

## Public Member Functions

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

## 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.

## 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.

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

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::CheckButton.

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

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::CheckButton.

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:

- radiobutton.h