Implement Program::load to specify startup Command

This commit is contained in:
Héctor Ramón Jiménez 2024-03-16 15:53:03 +01:00
parent 5a986897d2
commit 93ae790da1
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 122 additions and 77 deletions

View file

@ -5,8 +5,7 @@ use iced::window;
use iced::{Alignment, Command, Element, Length, Subscription};
pub fn main() -> iced::Result {
iced::application(Events::new, Events::update, Events::view)
.title("Events - Iced")
iced::application("Events - Iced", Events::update, Events::view)
.subscription(Events::subscription)
.ignore_close_request()
.run()
@ -26,10 +25,6 @@ enum Message {
}
impl Events {
fn new() -> (Events, Command<Message>) {
(Events::default(), Command::none())
}
fn update(&mut self, message: Message) -> Command<Message> {
match message {
Message::EventOccurred(event) if self.enabled => {