A choice from multiple check buttons
Class GtkRadioButton( radio_group_member )
radio_group_member | an existing GtkRadioButton, or nil if you are creating a new group. |
A single radio button performs the same basic function as a GtkCheckButton, 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 GtkRadioButton is one way of giving the user a choice from many options.
When an unselected button in the group is clicked the clicked button receives the "toggled" signal, as does the previously selected button. Inside the "toggled" handler, get_active() can be used to determine if the button has been selected or deselected.
Methods | |
get_group | Retrieves the group assigned to a radio button. |
new_with_label | Creates a new GtkRadioButton with a text label, adding it to the same group as radio_group_member. |
new_with_mnemonic | Creates a new GtkRadioButton containing a label. |
set_group | Sets a GtkRadioButton's group. |
signal_group_changed | Emitted when the group of radio buttons that a radio button belongs to changes. |
Retrieves the group assigned to a radio button.
GtkRadioButton.get_group()
Return | an array containing GtkRadioButton objects belonging to the group. |
Creates a new GtkRadioButton with a text label, adding it to the same group as radio_group_member.
GtkRadioButton.new_with_label( radio_group_member, label )
radio_group_member | widget to get radio group from, or nil if you are creating a new group. |
label | the text label to display next to the radio button. |
Creates a new GtkRadioButton containing a label.
GtkRadioButton.new_with_mnemonic( radio_group_member, label )
radio_group_member | widget to get radio group from, or nil if you are creating a new group. |
label | the text of the button, with an underscore in front of the mnemonic character |
The label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the button.
Sets a GtkRadioButton's group.
GtkRadioButton.set_group( group_member )
group_member | a GtkRadioButton belonging to the 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.
Emitted when the group of radio buttons that a radio button belongs to changes.
GtkRadioButton.signal_group_changed()
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.