Struct FancyVertSlider

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

Implementations§

Source§

impl FancyVertSlider

Source

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

Source

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

Source

pub fn value(&self) -> f64

Source

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

Source§

impl FancyVertSlider

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/sliders.rs (line 15)
4fn main() {
5    let a = app::App::default();
6    app::set_background_color(0, 0, 0);
7    app::set_foreground_color(255, 255, 255);
8    app::set_background2_color(128, 128, 128);
9    let mut w = window::Window::default().with_size(400, 300);
10    let col = group::Flex::default()
11        .column()
12        .with_size(200, 200)
13        .center_of_parent();
14    let _hslider = FancyHorSlider::default().with_label("Hor");
15    let _vslider = FancyVertSlider::default().with_label("Vert");
16    col.end();
17    w.end();
18    w.show();
19    a.run().unwrap();
20}
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 FancyVertSlider

Source§

fn clone(&self) -> FancyVertSlider

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 Debug for FancyVertSlider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FancyVertSlider

Source§

fn default() -> Self

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

impl Deref for FancyVertSlider

Source§

type Target = Pack

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for FancyVertSlider

Source§

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

Mutably dereferences the value.

Auto Trait Implementations§

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.