pub struct CheckButton { /* private fields */ }

Implementations§

source§

impl CheckButton

source

pub fn new(x: i32, y: i32, w: i32, _h: i32, label: &str) -> Self

source

pub fn set_value(&mut self, val: bool)

source

pub fn value(&self) -> bool

source

pub fn set_callback<F: 'static + FnMut(&mut Self)>(&mut self, cb: F)

source§

impl CheckButton

source

pub fn with_pos(self, x: i32, y: i32) -> Self

Initialize to position x, y

source

pub fn with_size(self, width: i32, height: i32) -> Self

Initialize to size width, height

source

pub fn with_label(self, title: &str) -> Self

Initialize with a label

Examples found in repository?
examples/buttons.rs (line 17)
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
fn main() {
    let a = app::App::default();
    app::set_background_color(0, 0, 0);
    app::set_foreground_color(255, 255, 255);
    app::set_background2_color(128, 128, 128);
    let mut w = window::Window::default().with_size(400, 400);
    let col = group::Flex::default()
        .with_size(80, 300)
        .column()
        .center_of_parent();
    Toggle::default();
    RoundToggle::default();
    RoundToggle2::default();
    CheckButton::default().with_label("Done?");
    HollowRoundToggle::default();
    RadioButton::default().with_label("Radio");
    HoverButton::default().with_label("Hello");
    col.end();
    w.end();
    w.show();
    a.run().unwrap();
}
source

pub fn with_align(self, align: Align) -> Self

Initialize with alignment

source

pub fn with_type<T: WidgetType>(self, typ: T) -> Self

Initialize with type

source

pub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize at bottom of another widget

source

pub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize above of another widget

source

pub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize right of another widget

source

pub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize left of another widget

source

pub fn center_of<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget

source

pub fn center_x<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the x axis

source

pub fn center_y<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the y axis

source

pub fn center_of_parent(self) -> Self

Initialize center of parent

source

pub fn size_of<W: WidgetExt>(self, w: &W) -> Self

Initialize to the size of another widget

source

pub fn size_of_parent(self) -> Self

Initialize to the size of the parent

Methods from Deref<Target = ToggleButton>§

source

pub fn is_toggled(&self) -> bool

Check whether a ToggleButton is toggled

source

pub fn toggle(&mut self, val: bool)

Sets whether the ToggleButton is toggled or not

Trait Implementations§

source§

impl Clone for CheckButton

source§

fn clone(&self) -> CheckButton

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for CheckButton

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for CheckButton

§

type Target = ToggleButton

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for CheckButton

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.