fix: add run_with(Example::new)
The example was not running the `update` method and was stuck on the loading screen (at least on macos). This fixes is on my system.
This commit is contained in:
parent
3b2a422d5d
commit
334f5baa10
1 changed files with 5 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ pub fn main() -> iced::Result {
|
|||
Example::update,
|
||||
Example::view,
|
||||
)
|
||||
.run()
|
||||
.run_with(Example::new)
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
@ -28,6 +28,10 @@ enum Message {
|
|||
}
|
||||
|
||||
impl Example {
|
||||
fn new() -> (Self, Task<Message>) {
|
||||
(Self::Loading, Task::done(Message::Refresh))
|
||||
}
|
||||
|
||||
fn update(&mut self, message: Message) -> Task<Message> {
|
||||
match message {
|
||||
Message::Refresh => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue