IClassicDesktopStyleApplicationLifetime
trait · ferroui-controls · v0.5.0
trait IClassicDesktopStyleApplicationLifetime: IControlledApplicationLifetime
Controls application lifetime in classic desktop style.
This contract is not meant to be implemented by applications.
Members
try_shutdownargsshutdown_modeset_shutdown_modemain_windowset_main_windowwindowsshutdown_requested
try_shutdown
fn try_shutdown(self: &Self, exit_code: i32) -> bool
Tries to shut down the application. The
shutdown_requested event can be used to
cancel the shutdown.
exit_code is an integer exit code for an application; the default
exit code is 0.
args
fn args(self: &Self) -> Option<Vec<String>>
The arguments passed to the builder's
start_with_classic_desktop_lifetime method.
shutdown_mode
fn shutdown_mode(self: &Self) -> ShutdownMode
The shutdown mode. This property indicates whether the application
is shut down explicitly or implicitly. If it is set to
ShutdownMode::OnExplicitShutdown the application only closes if
shutdown is called. The default is
ShutdownMode::OnLastWindowClose.
set_shutdown_mode
fn set_shutdown_mode(self: &Self, value: ShutdownMode)
Sets the shutdown mode.
main_window
fn main_window(self: &Self) -> Option<Ref<Window>>
The main window of the application.
set_main_window
fn set_main_window(self: &Self, value: Option<Ref<Window>>)
Sets the main window of the application.
windows
fn windows(self: &Self) -> Vec<Ref<Window>>
The list of all open windows in the application.
shutdown_requested
fn shutdown_requested(self: &Self, handler: Rc<dyn Fn(&ShutdownRequestedEventArgs) -> ()>) -> Rc<dyn IDisposable>
Raised by the platform when an application shutdown is requested. Disposing the returned handle unsubscribes.
Application shutdown can be requested for various reasons like an operating system shutdown: the end of the session (logout or shutdown), the quit menu of the application, or the quit command of the application icon. Cancelling the event args blocks the shutdown of the operating system where the platform allows it.
This event provides a first chance to cancel application shutdown;
if shutdown is not canceled at this point the application will try
to close each non-owned open window, invoking the
Window::closing event on each and allowing each window to cancel
the shutdown of the application. Windows cannot however prevent the
shutdown of the operating system.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.