pub struct RadioGroup { /* private fields */ }Expand description
A radio button group widget for single selection
Implementations§
Source§impl RadioGroup
impl RadioGroup
Sourcepub fn style(self, style: RadioStyle) -> Self
pub fn style(self, style: RadioStyle) -> Self
Set radio style
Sourcepub fn layout(self, layout: RadioLayout) -> Self
pub fn layout(self, layout: RadioLayout) -> Self
Set layout direction
Sourcepub fn selected_fg(self, color: Color) -> Self
pub fn selected_fg(self, color: Color) -> Self
Set selected indicator color
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get selected index
Sourcepub fn selected_value(&self) -> Option<&str>
pub fn selected_value(&self) -> Option<&str>
Get selected option value
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Check if focused
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if disabled
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Select next option (wraps around)
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Select previous option (wraps around)
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set focus state (mutable)
Sourcepub fn set_selected(&mut self, index: usize)
pub fn set_selected(&mut self, index: usize)
Set selected index (mutable)
Sourcepub fn handle_key(&mut self, key: &Key) -> bool
pub fn handle_key(&mut self, key: &Key) -> bool
Handle key input, returns true if selection changed
Source§impl RadioGroup
impl RadioGroup
Trait Implementations§
Source§impl Clone for RadioGroup
impl Clone for RadioGroup
Source§fn clone(&self) -> RadioGroup
fn clone(&self) -> RadioGroup
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for RadioGroup
impl Default for RadioGroup
Source§impl StyledView for RadioGroup
impl StyledView for RadioGroup
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Source§impl View for RadioGroup
impl View for RadioGroup
Source§fn meta(&self) -> WidgetMeta
fn meta(&self) -> WidgetMeta
Get widget metadata for DOM
Source§fn render(&self, ctx: &mut RenderContext<'_>)
fn render(&self, ctx: &mut RenderContext<'_>)
Render the view
Source§fn widget_type(&self) -> &'static str
fn widget_type(&self) -> &'static str
Get widget type name (for CSS type selectors)
Auto Trait Implementations§
impl !Freeze for RadioGroup
impl !RefUnwindSafe for RadioGroup
impl Send for RadioGroup
impl !Sync for RadioGroup
impl Unpin for RadioGroup
impl UnwindSafe for RadioGroup
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