Buttons
gtkmm provides four basic types of buttons:
Push-Buttons 	 Gtk::Button. Standard buttons, usually marked with a label or picture. Pushing one triggers an action. See the Button section.
Toggle buttons 	 Gtk::ToggleButton. Unlike a normal Button, which springs back up, a ToggleButton stays down until you press it again. It might be useful as an on/off switch. See the ToggleButton section.
Checkboxes 	 Gtk::CheckButton. These act like ToggleButtons, but show their state in small squares, with their label at the side. They should be used in most situations which require an on/off setting. See the CheckButton section.
Radio buttons 	 Gtk::RadioButton. Named after the station selectors on old car radios, these buttons are used in groups for options which are mutually exclusive. Pressing one causes all the others in its group to turn off. They are similar to CheckBoxes (a small widget with a label at the side), but usually look different. See the RadioButton section.
Note that, due to GTK+'s theming system, the appearance of these widgets will vary. In the case of checkboxes and radio buttons, they may vary considerably.

Button

Constructors
There are two ways to create a Button. You can specify a label string in the Gtk::Button constructor, or set it later with set_label().
To define an accelerator key for keyboard navigation, place an underscore before one of the label's characters and specify true for the optional mnemonic parameter. For instance:

Gtk::Button* pButton = new Gtk::Button("_Something", true);

Stock items have been recommended for use in buttons. From gtkmm-3.10 they are deprecated. They should not be used in newly-written code. However, the documentation of namespace Gtk::Stock shows recommended labels and named icons to show in buttons.
Gtk::Button is also a container so you could put any other widget, such as a Gtk::Image into it.
Reference

Example
This example creates a button with a picture and a label.

buttons example
Source Code

Signals
The Gtk::Button widget has the following signals, but most of the time you will just handle the clicked signal:
pressed 	 Emitted when the button is pressed.
released 	 Emitted when the button is released.
clicked 	 Emitted when the button is pressed and released.
enter 	 Emitted when the mouse pointer moves over the button's window.
leave 	 Emitted when the mouse pointer leaves the button's window.

ToggleButton
ToggleButtons are like normal Buttons, but when clicked they remain activated, or pressed, until clicked again.
To retrieve the state of the ToggleButton, you can use the get_active() method. This returns true if the button is "down". You can also set the toggle button's state, with set_active(). Note that, if you do this, and the state actually changes, it causes the "clicked" signal to be emitted. This is usually what you want.
You can use the toggled() method to toggle the button, rather than forcing it to be up or down: This switches the button's state, and causes the toggled signal to be emitted.
Gtk::ToggleButton is most useful as a base class for the Gtk::CheckButton and Gtk::RadioButton classes.
Reference

CheckButton
Gtk::CheckButton inherits from Gtk::ToggleButton. The only real difference between the two is Gtk::CheckButton's appearance. You can check, set, and toggle a checkbox using the same member methods as for Gtk::ToggleButton.
Reference

Example

CheckButton
Source Code

RadioButton
Like checkboxes, radio buttons also inherit from Gtk::ToggleButton, but these work in groups, and only one RadioButton in a group can be selected at any one time.

Groups
There are two ways to set up a group of radio buttons. The first way is to create the buttons, and set up their groups afterwards. Only the first two constructors are used. In the following example, we make a new window class called RadioButtons, and then put three radio buttons in it:

class RadioButtons : public Gtk::Window
{
public:
    RadioButtons();

protected:
    Gtk::RadioButton m_rb1, m_rb2, m_rb3;
};

RadioButtons::RadioButtons()
  : m_rb1("button1"),
    m_rb2("button2"),
    m_rb3("button3")
{
    Gtk::RadioButton::Group group = m_rb1.get_group();
    m_rb2.set_group(group);
    m_rb3.set_group(group);
}

We told gtkmm to put all three RadioButtons in the same group by obtaining the group with get_group() and using set_group() to tell the other RadioButtons to share that group.
Note that you can't just do

m_rb2.set_group(m_rb1.get_group()); //doesn't work

because the group is modified by set_group() and therefore non-const.
The second way to set up radio buttons is to make a group first, and then add radio buttons to it. Here's an example:

class RadioButtons : public Gtk::Window
{
public:
    RadioButtons();
};

RadioButtons::RadioButtons()
{
    Gtk::RadioButton::Group group;
    Gtk::RadioButton *m_rb1 = Gtk::manage(
      new Gtk::RadioButton(group,"button1"));
    Gtk::RadioButton *m_rb2 = manage(
      new Gtk::RadioButton(group,"button2"));
      Gtk::RadioButton *m_rb3 = manage(
        new Gtk::RadioButton(group,"button3"));
}

We made a new group by simply declaring a variable, group, of type Gtk::RadioButton::Group. Then we made three radio buttons, using a constructor to make each of them part of group.

Methods
RadioButtons are "off" when created; this means that when you first make a group of them, they will all be off. Don't forget to turn one of them on using set_active():
Reference

Example
The following example demonstrates the use of RadioButtons:

RadioButton
Source Code