diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs index c0bd2efe..ffadb14f 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour/src/main.rs @@ -1,8 +1,7 @@ use iced::{ - button, executor, scrollable, slider, text_input, Application, Button, - Checkbox, Color, Column, Command, Container, Element, HorizontalAlignment, - Image, Length, Radio, Row, Scrollable, Settings, Slider, Space, Text, - TextInput, + button, scrollable, slider, text_input, Button, Checkbox, Color, Column, + Container, Element, HorizontalAlignment, Image, Length, Radio, Row, + Sandbox, Scrollable, Settings, Slider, Space, Text, TextInput, }; pub fn main() { @@ -19,29 +18,24 @@ pub struct Tour { debug: bool, } -impl Application for Tour { - type Executor = executor::Null; +impl Sandbox for Tour { type Message = Message; - type Flags = (); - fn new(_flags: ()) -> (Tour, Command) { - ( - 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 { + fn update(&mut self, event: Message) { match event { Message::BackPressed => { self.steps.go_back(); @@ -53,8 +47,6 @@ impl Application for Tour { self.steps.update(step_msg, &mut self.debug); } } - - Command::none() } fn view(&mut self) -> Element {