pub struct WindowClosingEventArgs { /* private fields */ }Expand description
Provides data for the window closing event.
The args are a reference object: a copy shares the cancel flag with the args it was made from, so that a handler given a copy cancels the closing, and copies compare by identity.
Implementations§
Source§impl WindowClosingEventArgs
impl WindowClosingEventArgs
Sourcepub fn new(reason: WindowCloseReason, is_programmatic: bool) -> Self
pub fn new(reason: WindowCloseReason, is_programmatic: bool) -> Self
Creates the event args. Only the windowing classes raise the event.
Sourcepub fn set_cancel(&self, value: bool)
pub fn set_cancel(&self, value: bool)
Sets whether the event should be canceled.
Sourcepub fn close_reason(&self) -> WindowCloseReason
pub fn close_reason(&self) -> WindowCloseReason
Gets a value that indicates why the window is being closed.
Sourcepub fn is_programmatic(&self) -> bool
pub fn is_programmatic(&self) -> bool
Gets a value indicating whether the window is being closed programmatically.
Trait Implementations§
Source§impl Clone for WindowClosingEventArgs
impl Clone for WindowClosingEventArgs
Source§impl Debug for WindowClosingEventArgs
impl Debug for WindowClosingEventArgs
Auto Trait Implementations§
impl !RefUnwindSafe for WindowClosingEventArgs
impl !Send for WindowClosingEventArgs
impl !Sync for WindowClosingEventArgs
impl !UnwindSafe for WindowClosingEventArgs
impl Freeze for WindowClosingEventArgs
impl Unpin for WindowClosingEventArgs
impl UnsafeUnpin for WindowClosingEventArgs
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more