Struct cursive::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
sourceimpl<T> RadioGroup<T>where
T: 'static,
impl<T> RadioGroup<T>where
T: 'static,
sourcepub fn new() -> RadioGroup<T>
pub fn new() -> RadioGroup<T>
Creates an empty group for radio buttons.
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>(&mut self, on_change: F)where
F: 'static + Fn(&mut Cursive, &T),
pub fn set_on_change<F>(&mut self, on_change: F)where
F: 'static + Fn(&mut Cursive, &T),
Sets a callback to be used when the selection changes.
sourceimpl RadioGroup<String>
impl RadioGroup<String>
Adds a button, using the label itself as value.
Trait Implementations
sourceimpl<T> Clone for RadioGroup<T>
impl<T> Clone for RadioGroup<T>
sourcefn clone(&self) -> RadioGroup<T>
fn clone(&self) -> RadioGroup<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Default for RadioGroup<T>where
T: 'static,
impl<T> Default for RadioGroup<T>where
T: 'static,
sourcefn default() -> RadioGroup<T>
fn default() -> RadioGroup<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for RadioGroup<T>
impl<T> !Send for RadioGroup<T>
impl<T> !Sync for RadioGroup<T>
impl<T> Unpin for RadioGroup<T>
impl<T> !UnwindSafe for RadioGroup<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more