pub struct RadiobuttonSet { /* private fields */ }
Expand description
A convenience wrapper for managing Radiobutton
s.
Implementations§
Sourcepub fn new() -> RadiobuttonSet
pub fn new() -> RadiobuttonSet
Create an empty RadiobuttonSet
.
Add a Radiobutton
to the RadiobuttonSet
.
left
- The left-most position of theRadiobutton
.top
- The top-most position of theRadiobutton
.text
- The text to be displayed as the label of theRadiobutton
.
Returns
the index number of the Radiobutton
that was added
to the RadiobuttonSet
.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the number of Radiobuttons
in the RadiobuttonSet
.
Returns
the number of Radiobuttons
in the RadiobuttonSet
.
Sourcepub fn add_to_form<'a>(
&'a self,
form: &mut Form<'a>,
) -> Result<(), &'static str>
pub fn add_to_form<'a>( &'a self, form: &mut Form<'a>, ) -> Result<(), &'static str>
Add all Radiobutton
s in the RadiobuttonSet
to a Form
.
form
- TheForm
to add theRadiobutton
s to.
Sourcepub fn get_current(&self) -> usize
pub fn get_current(&self) -> usize
Get the currently selected Radiobutton
from the RadiobuttonSet
.
Returns
the index of the currently selected Radiobutton
.
Sourcepub fn set_current(&self, index: usize)
pub fn set_current(&self, index: usize)
Set the currently selected Radiobutton
in the RadiobuttonSet
.
index
- The index number of theRadiobutton
in theRadiobuttonSet
to be selected.
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more