Implement Program::load to specify startup Command
This commit is contained in:
parent
5a986897d2
commit
93ae790da1
8 changed files with 122 additions and 77 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue