pub struct CheckBox<'a> { /* private fields */ }Expand description
CheckBox widget.
A toggleable checkbox with a label that supports focus styling and mouse click regions.
Implementations§
Source§impl<'a> CheckBox<'a>
impl<'a> CheckBox<'a>
Sourcepub fn new(label: &'a str, state: &'a CheckBoxState) -> Self
pub fn new(label: &'a str, state: &'a CheckBoxState) -> Self
Create a new checkbox.
§Arguments
label- The text label displayed next to the checkboxstate- Reference to the checkbox state
Sourcepub fn style(self, style: CheckBoxStyle) -> Self
pub fn style(self, style: CheckBoxStyle) -> Self
Set the checkbox style.
Sourcepub fn render_stateful(
self,
area: Rect,
buf: &mut Buffer,
) -> ClickRegion<CheckBoxAction>
pub fn render_stateful( self, area: Rect, buf: &mut Buffer, ) -> ClickRegion<CheckBoxAction>
Render the checkbox and return the click region.
Use this method when you need to track click regions for mouse handling.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CheckBox<'a>
impl<'a> RefUnwindSafe for CheckBox<'a>
impl<'a> Send for CheckBox<'a>
impl<'a> Sync for CheckBox<'a>
impl<'a> Unpin for CheckBox<'a>
impl<'a> UnwindSafe for CheckBox<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more