FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    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.

    Source

    args

    fn args(self: &Self) -> Option<Vec<String>>
    

    The arguments passed to the builder's start_with_classic_desktop_lifetime method.

    Source

    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.

    Source

    set_shutdown_mode

    fn set_shutdown_mode(self: &Self, value: ShutdownMode)
    

    Sets the shutdown mode.

    Source

    main_window

    fn main_window(self: &Self) -> Option<Ref<Window>>
    

    The main window of the application.

    Source

    set_main_window

    fn set_main_window(self: &Self, value: Option<Ref<Window>>)
    

    Sets the main window of the application.

    Source

    windows

    fn windows(self: &Self) -> Vec<Ref<Window>>
    

    The list of all open windows in the application.

    Source

    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.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.