From 334f5baa106f8e2c86448f9b10f869b7ef0a2fe0 Mon Sep 17 00:00:00 2001 From: "Osma S. Rautila" <44613540+xosxos@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:31:27 +0200 Subject: 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. --- examples/system_information/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/system_information/src/main.rs') diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs index 363df590..46176d93 100644 --- a/examples/system_information/src/main.rs +++ b/examples/system_information/src/main.rs @@ -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) { + (Self::Loading, Task::done(Message::Refresh)) + } + fn update(&mut self, message: Message) -> Task { match message { Message::Refresh => { -- cgit