diff options
Diffstat (limited to '')
| -rw-r--r-- | examples/exit/src/main.rs | 20 | 
1 files changed, 3 insertions, 17 deletions
| diff --git a/examples/exit/src/main.rs b/examples/exit/src/main.rs index ec618dc1..4948bd0f 100644 --- a/examples/exit/src/main.rs +++ b/examples/exit/src/main.rs @@ -1,10 +1,9 @@ -use iced::executor;  use iced::widget::{button, column, container};  use iced::window; -use iced::{Alignment, Application, Command, Element, Length, Settings, Theme}; +use iced::{Alignment, Command, Element, Length};  pub fn main() -> iced::Result { -    Exit::run(Settings::default()) +    iced::application("Exit - Iced", Exit::update, Exit::view).run()  }  #[derive(Default)] @@ -18,20 +17,7 @@ enum Message {      Exit,  } -impl Application for Exit { -    type Executor = executor::Default; -    type Message = Message; -    type Theme = Theme; -    type Flags = (); - -    fn new(_flags: ()) -> (Self, Command<Message>) { -        (Self::default(), Command::none()) -    } - -    fn title(&self) -> String { -        String::from("Exit - Iced") -    } - +impl Exit {      fn update(&mut self, message: Message) -> Command<Message> {          match message {              Message::Confirm => window::close(window::Id::MAIN), | 
