pub struct Checkbox<'a> { /* private fields */ }
Expand description
Boolean on/off control with text label.
Usually you’d use Ui::checkbox
instead.
// These are equivalent:
ui.checkbox(&mut my_bool, "Checked");
ui.add(egui::Checkbox::new(&mut my_bool, "Checked"));
Implementations§
source§impl<'a> Checkbox<'a>
impl<'a> Checkbox<'a>
pub fn new(checked: &'a mut bool, text: impl Into<WidgetText>) -> Self
pub fn without_text(checked: &'a mut bool) -> Self
sourcepub fn indeterminate(self, indeterminate: bool) -> Self
pub fn indeterminate(self, indeterminate: bool) -> Self
Display an indeterminate state (neither checked nor unchecked)
This only affects the checkbox’s appearance. It will still toggle its boolean value when clicked.
Trait Implementations§
Auto Trait Implementations§
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