Radio Buttons

Radio buttons are buttons that display a “selected” indicator next to their label, and belong to a group of similar buttons. Only one radio button in the group can be selected.

GtkWidget *live = gtk_check_button_new_with_label ("Live");
GtkWidget *laugh = gtk_check_button_new_with_label ("Laugh");
GtkWidget *love = gtk_check_button_new_with_label ("Love");

gtk_check_button_set_group (GTK_CHECK_BUTTON (laugh),
                            GTK_CHECK_BUTTON (live));
gtk_check_button_set_group (GTK_CHECK_BUTTON (love),
                            GTK_CHECK_BUTTON (live));

Useful methods for the component

  • If you want to enable a mnemonic shortcut for your radio button, you can use the new_with_mnemonic() constructor, or the set_use_underline() method.

API references

In the examples we used the following classes: