pub struct Dial { /* private fields */ }
Implementations§
Source§impl Dial
impl Dial
pub fn new(x: i32, y: i32, w: i32, h: i32, label: &str) -> Self
Sourcepub fn set_value(&mut self, val: i32)
pub fn set_value(&mut self, val: i32)
Examples found in repository?
examples/dials.rs (line 16)
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(100, 200)
13 .center_of_parent();
14 let mut dial = Dial::default();
15 dial.modifiable(false);
16 dial.set_value(75);
17 let mut halfdial = HalfDial::default();
18 halfdial.set_value(23);
19 col.end();
20 w.end();
21 w.show();
22 a.run().unwrap();
23}
Sourcepub fn modifiable(&mut self, val: bool)
pub fn modifiable(&mut self, val: bool)
Examples found in repository?
examples/dials.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(100, 200)
13 .center_of_parent();
14 let mut dial = Dial::default();
15 dial.modifiable(false);
16 dial.set_value(75);
17 let mut halfdial = HalfDial::default();
18 halfdial.set_value(23);
19 col.end();
20 w.end();
21 w.show();
22 a.run().unwrap();
23}
pub fn set_callback<F: 'static + FnMut(&mut Self)>(&mut self, cb: F)
Source§impl Dial
impl Dial
Sourcepub fn with_label(self, title: &str) -> Self
pub fn with_label(self, title: &str) -> Self
Initialize with a label
Sourcepub fn with_align(self, align: Align) -> Self
pub fn with_align(self, align: Align) -> Self
Initialize with alignment
Sourcepub fn with_type<T: WidgetType>(self, typ: T) -> Self
pub fn with_type<T: WidgetType>(self, typ: T) -> Self
Initialize with type
Sourcepub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize at bottom of another widget
Sourcepub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize above of another widget
Sourcepub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize right of another widget
Sourcepub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize left of another widget
Sourcepub fn center_x<W: WidgetExt>(self, w: &W) -> Self
pub fn center_x<W: WidgetExt>(self, w: &W) -> Self
Initialize center of another widget on the x axis
Sourcepub fn center_y<W: WidgetExt>(self, w: &W) -> Self
pub fn center_y<W: WidgetExt>(self, w: &W) -> Self
Initialize center of another widget on the y axis
Sourcepub fn center_of_parent(self) -> Self
pub fn center_of_parent(self) -> Self
Initialize center of parent
Sourcepub fn size_of_parent(self) -> Self
pub fn size_of_parent(self) -> Self
Initialize to the size of the parent
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dial
impl RefUnwindSafe for Dial
impl Send for Dial
impl Sync for Dial
impl Unpin for Dial
impl UnwindSafe for Dial
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