diff options
author | 2024-07-30 22:26:55 +0200 | |
---|---|---|
committer | 2024-07-30 22:26:55 +0200 | |
commit | fd593f8fb0c8476463f9c04ae2bcc96784b8c530 (patch) | |
tree | 8f9413a9b642aaaf6de091694d429def07966892 /examples/multi_window | |
parent | 8f335757192701c4d276016ec68da6aa34b6c568 (diff) | |
download | iced-fd593f8fb0c8476463f9c04ae2bcc96784b8c530.tar.gz iced-fd593f8fb0c8476463f9c04ae2bcc96784b8c530.tar.bz2 iced-fd593f8fb0c8476463f9c04ae2bcc96784b8c530.zip |
Return `window::Id` in `window::open`
Diffstat (limited to 'examples/multi_window')
-rw-r--r-- | examples/multi_window/src/main.rs | 11 |
1 files changed, 7 insertions, 4 deletions
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<Message>) { + 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) } |