pub struct WindowHandle { /* private fields */ }Expand description
A live secondary window (docs/windows.md). Cheap to clone; inert after close.
Implementations§
Source§impl WindowHandle
impl WindowHandle
Sourcepub fn close(&self)
pub fn close(&self)
Close the window. Asynchronous: the platform (or the cover’s hide transition)
confirms, then the content is disposed and on_close callbacks run. Idempotent.
Sourcepub fn focus(&self)
pub fn focus(&self)
Bring the window to front and make it key. No-op on the cover tier (the cover is
already frontmost in the primary window) and while a Pending open is in flight.
Sourcepub fn set_title(&self, title: &str)
pub fn set_title(&self, title: &str)
Retitle the window. Applies to live native windows; a Pending window picks the
new title up at completion; the cover tier has no title bar (no-op).
Sourcepub fn is_open(&self) -> bool
pub fn is_open(&self) -> bool
Whether the window is still open (its record exists — a Pending open counts).
Sourcepub fn on_close(&self, f: impl Fn() + 'static)
pub fn on_close(&self, f: impl Fn() + 'static)
Run f after the window has closed and its content is disposed — any close path
(title-bar, platform gesture, WindowHandle::close). No-op if already closed.
Trait Implementations§
Source§impl Clone for WindowHandle
impl Clone for WindowHandle
Source§fn clone(&self) -> WindowHandle
fn clone(&self) -> WindowHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WindowHandle
impl RefUnwindSafe for WindowHandle
impl Send for WindowHandle
impl Sync for WindowHandle
impl Unpin for WindowHandle
impl UnsafeUnpin for WindowHandle
impl UnwindSafe for WindowHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more