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

@ -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),