Struct cursive_core::views::RadioGroup
source · pub struct RadioGroup<T> { /* private fields */ }
Expand description
Group to coordinate multiple radio buttons.
A RadioGroup
is used to create and manage RadioButton
s.
A RadioGroup
can be cloned; it will keep pointing to the same group.
Implementations§
source§impl<T: 'static> RadioGroup<T>
impl<T: 'static> RadioGroup<T>
Adds a new button to the group.
The button will display label
next to it, and will embed value
.
sourcepub fn selected_id(&self) -> usize
pub fn selected_id(&self) -> usize
Returns the id of the selected button.
Buttons are indexed in the order they are created, starting from 0.
sourcepub fn set_on_change<F: 'static + Fn(&mut Cursive, &T)>(&mut self, on_change: F)
pub fn set_on_change<F: 'static + Fn(&mut Cursive, &T)>(&mut self, on_change: F)
Sets a callback to be used when the selection changes.
source§impl RadioGroup<String>
impl RadioGroup<String>
Adds a button, using the label itself as value.