diff options
author | 2019-11-24 11:34:30 +0100 | |
---|---|---|
committer | 2019-11-24 11:34:30 +0100 | |
commit | 149fd2aa1fa86858c7c1dcec8fd844caa78cec94 (patch) | |
tree | a199cf8d2caaf6aa60e48e93d6dd0688969d43b0 /examples/tour.rs | |
parent | 9712b319bb7a32848001b96bd84977430f14b623 (diff) | |
parent | 47196c9007d12d3b3e0036ffabe3bf6d14ff4523 (diff) | |
download | iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.gz iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.bz2 iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.zip |
Merge pull request #65 from hecrj/improvement/docs
Documentation
Diffstat (limited to '')
-rw-r--r-- | examples/tour.rs | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/examples/tour.rs b/examples/tour.rs index f5bb84d1..8dbae2b8 100644 --- a/examples/tour.rs +++ b/examples/tour.rs @@ -1,8 +1,7 @@ use iced::{ - button, scrollable, slider, text::HorizontalAlignment, text_input, - Application, Background, Button, Checkbox, Color, Column, Command, - Container, Element, Image, Length, Radio, Row, Scrollable, Slider, Text, - TextInput, + button, scrollable, slider, text_input, Background, Button, Checkbox, + Color, Column, Container, Element, HorizontalAlignment, Image, Length, + Radio, Row, Sandbox, Scrollable, Slider, Text, TextInput, }; pub fn main() { @@ -19,27 +18,24 @@ pub struct Tour { debug: bool, } -impl Application for Tour { +impl Sandbox for Tour { type Message = Message; - fn new() -> (Tour, Command<Message>) { - ( - Tour { - steps: Steps::new(), - scroll: scrollable::State::new(), - back_button: button::State::new(), - next_button: button::State::new(), - debug: false, - }, - Command::none(), - ) + fn new() -> Tour { + Tour { + steps: Steps::new(), + scroll: scrollable::State::new(), + back_button: button::State::new(), + next_button: button::State::new(), + debug: false, + } } fn title(&self) -> String { format!("{} - Iced", self.steps.title()) } - fn update(&mut self, event: Message) -> Command<Message> { + fn update(&mut self, event: Message) { match event { Message::BackPressed => { self.steps.go_back(); @@ -51,8 +47,6 @@ impl Application for Tour { self.steps.update(step_msg, &mut self.debug); } } - - Command::none() } fn view(&mut self) -> Element<Message> { |