diff options
author | 2024-03-19 22:09:36 +0900 | |
---|---|---|
committer | 2024-03-19 22:09:36 +0900 | |
commit | f3a1c785b2743e9c48c3d28df0c6772ce579d7c8 (patch) | |
tree | 1b39799f45878d89b4f9e2f9bea8fa8a7ed07150 /examples/modal | |
parent | c9453cd55d84f0dd2ad0050208863d036c98843f (diff) | |
parent | 8ce16aba6204cb5c02a709cdf79c309f7b7e0196 (diff) | |
download | iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.tar.gz iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.tar.bz2 iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.zip |
Merge branch 'iced-rs:master' into viewer_content_fit
Diffstat (limited to 'examples/modal')
-rw-r--r-- | examples/modal/src/main.rs | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/examples/modal/src/main.rs b/examples/modal/src/main.rs index e1fc04c0..398728e0 100644 --- a/examples/modal/src/main.rs +++ b/examples/modal/src/main.rs @@ -1,20 +1,19 @@ use iced::event::{self, Event}; -use iced::executor; use iced::keyboard; use iced::keyboard::key; use iced::widget::{ self, button, column, container, horizontal_space, pick_list, row, text, text_input, }; -use iced::{ - Alignment, Application, Command, Element, Length, Settings, Subscription, -}; +use iced::{Alignment, Command, Element, Length, Subscription}; use modal::Modal; use std::fmt; pub fn main() -> iced::Result { - App::run(Settings::default()) + iced::program("Modal - Iced", App::update, App::view) + .subscription(App::subscription) + .run() } #[derive(Default)] @@ -36,21 +35,8 @@ enum Message { Event(Event), } -impl Application for App { - type Executor = executor::Default; - type Message = Message; - type Theme = iced::Theme; - type Flags = (); - - fn new(_flags: ()) -> (Self, Command<Message>) { - (App::default(), Command::none()) - } - - fn title(&self) -> String { - String::from("Modal - Iced") - } - - fn subscription(&self) -> Subscription<Self::Message> { +impl App { + fn subscription(&self) -> Subscription<Message> { event::listen().map(Message::Event) } |