Return window::Id in window::open
This commit is contained in:
parent
8f33575719
commit
fd593f8fb0
3 changed files with 17 additions and 10 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue