Trait gtk::prelude::RadioButtonExt[][src]

pub trait RadioButtonExt: 'static {
    fn group(&self) -> Vec<RadioButton>;
fn join_group<P: IsA<RadioButton>>(&self, group_source: Option<&P>);
fn connect_group_changed<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }
Expand description

Trait containing all RadioButton methods.

Implementors

RadioButton

Required methods

Retrieves the group assigned to a radio button.

Returns

a linked list containing all the radio buttons in the same group as self. The returned list is owned by the radio button and must not be modified or freed.

Joins a RadioButton object to the group of another RadioButton object

Use this in language bindings instead of the group() and gtk_radio_button_set_group() methods

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

⚠️ The following code is in C ⚠️

  GtkRadioButton *radio_button;
  GtkRadioButton *last_button;

  while (some_condition)
    {
       radio_button = gtk_radio_button_new (NULL);

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

group_source

a radio button object whos group we are joining, or None to remove the radio button from its group

Emitted when the group of radio buttons that a radio button belongs to changes. 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.

Implementors