Return window::Id in window::open
This commit is contained in:
parent
8f33575719
commit
fd593f8fb0
3 changed files with 17 additions and 10 deletions
|
|
@ -218,12 +218,15 @@ pub fn close_requests() -> Subscription<Id> {
|
|||
|
||||
/// Opens a new window with the given [`Settings`]; producing the [`Id`]
|
||||
/// of the new window on completion.
|
||||
pub fn open(settings: Settings) -> Task<Id> {
|
||||
pub fn open(settings: Settings) -> (Id, Task<Id>) {
|
||||
let id = Id::unique();
|
||||
|
||||
task::oneshot(|channel| {
|
||||
crate::Action::Window(Action::Open(id, settings, channel))
|
||||
})
|
||||
(
|
||||
id,
|
||||
task::oneshot(|channel| {
|
||||
crate::Action::Window(Action::Open(id, settings, channel))
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
/// Closes the window with `id`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue