From fd593f8fb0c8476463f9c04ae2bcc96784b8c530 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 30 Jul 2024 22:26:55 +0200 Subject: Return `window::Id` in `window::open` --- examples/multi_window/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'examples/multi_window/src') diff --git a/examples/multi_window/src/main.rs b/examples/multi_window/src/main.rs index 3dcb58f5..ab09116e 100644 --- a/examples/multi_window/src/main.rs +++ b/examples/multi_window/src/main.rs @@ -40,12 +40,13 @@ enum Message { impl Example { fn new() -> (Self, Task) { + let (_id, open) = window::open(window::Settings::default()); + ( Self { windows: BTreeMap::new(), }, - window::open(window::Settings::default()) - .map(Message::WindowOpened), + open.map(Message::WindowOpened), ) } @@ -74,10 +75,12 @@ impl Example { }, ); - window::open(window::Settings { + let (_id, open) = window::open(window::Settings { position, ..window::Settings::default() - }) + }); + + open }) .map(Message::WindowOpened) } -- cgit