pub struct Checkbox {
pub style: Style,
pub text_color: Color,
pub check_color: Color,
/* private fields */
}Expand description
Standard checkbox widget with label text.
Fields§
§style: StyleVisual styling for the checkbox box and label.
text_color: ColorColor used when rendering the label text.
check_color: ColorColor of the check mark when selected.
Implementations§
Source§impl Checkbox
impl Checkbox
Sourcepub fn is_checked(&self) -> bool
pub fn is_checked(&self) -> bool
Return whether the checkbox is currently checked.
Sourcepub fn set_checked(&mut self, value: bool)
pub fn set_checked(&mut self, value: bool)
Set the checked state programmatically.
Sourcepub fn set_font(&mut self, font: &'static dyn FontMetrics)
pub fn set_font(&mut self, font: &'static dyn FontMetrics)
Assign the font used to render this widget (FONT-00 §5); resolves to
FONT_6X10 when unset.
Trait Implementations§
Source§impl Widget for Checkbox
impl Widget for Checkbox
Source§fn handle_event(&mut self, event: &Event) -> bool
fn handle_event(&mut self, event: &Event) -> bool
Toggle the checked state when clicked.
Source§fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
Expose this widget’s font slot for cascade-driven font resolution
(FONT-05 §5.B). Read more
Source§fn clear_region(&mut self) -> Option<Rect>
fn clear_region(&mut self) -> Option<Rect>
Return a region (in draw/landscape coordinates) that should be
restored from the pristine background copy, or
None. Read moreSource§fn set_bounds(&mut self, _bounds: Rect)
fn set_bounds(&mut self, _bounds: Rect)
Called by the LPAR-10 layout pass to notify this widget of its
layout-computed bounds. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Checkbox
impl !Send for Checkbox
impl !Sync for Checkbox
impl !UnwindSafe for Checkbox
impl Freeze for Checkbox
impl Unpin for Checkbox
impl UnsafeUnpin for Checkbox
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