diff options
author | 2024-03-16 15:53:03 +0100 | |
---|---|---|
committer | 2024-03-16 15:54:37 +0100 | |
commit | 93ae790da14544667176ecdbdd6a4eaaa98a248a (patch) | |
tree | 4af03301f9a16049d29be305c48b4054a3afee99 /examples/exit | |
parent | 5a986897d22f6d79a7a1fbaa4f3d1aaa1f9ca3bb (diff) | |
download | iced-93ae790da14544667176ecdbdd6a4eaaa98a248a.tar.gz iced-93ae790da14544667176ecdbdd6a4eaaa98a248a.tar.bz2 iced-93ae790da14544667176ecdbdd6a4eaaa98a248a.zip |
Implement `Program::load` to specify startup `Command`
Diffstat (limited to 'examples/exit')
-rw-r--r-- | examples/exit/src/main.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/examples/exit/src/main.rs b/examples/exit/src/main.rs index dc78b0bb..4948bd0f 100644 --- a/examples/exit/src/main.rs +++ b/examples/exit/src/main.rs @@ -3,9 +3,7 @@ use iced::window; use iced::{Alignment, Command, Element, Length}; pub fn main() -> iced::Result { - iced::application(Exit::new, Exit::update, Exit::view) - .title("Exit - Iced") - .run() + iced::application("Exit - Iced", Exit::update, Exit::view).run() } #[derive(Default)] @@ -20,10 +18,6 @@ enum Message { } impl Exit { - fn new() -> (Self, Command<Message>) { - (Self::default(), Command::none()) - } - fn update(&mut self, message: Message) -> Command<Message> { match message { Message::Confirm => window::close(window::Id::MAIN), |