Struct Toggle

Source
pub struct Toggle { /* private fields */ }

Implementations§

Source§

impl Toggle

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 Toggle

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

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 = Pack>§

Source

pub fn spacing(&self) -> i32

Get the spacing of the pack

Source

pub fn set_spacing(&mut self, spacing: i32)

Set the spacing of the pack

Source

pub fn auto_layout(&mut self)

Layout the children of the pack automatically. Must be called on existing children

Trait Implementations§

Source§

impl Clone for Toggle

Source§

fn clone(&self) -> Toggle

Returns a duplicate 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 Toggle

Source§

fn default() -> Self

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

impl Deref for Toggle

Source§

type Target = Pack

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for Toggle

Source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl Freeze for Toggle

§

impl RefUnwindSafe for Toggle

§

impl Send for Toggle

§

impl Sync for Toggle

§

impl Unpin for Toggle

§

impl UnwindSafe for Toggle

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.