AppDelegate

Trait AppDelegate 

Source
pub trait AppDelegate: Send + Sync {
    // Provided methods
    fn will_finish_launching(&mut self) { ... }
    fn did_finish_launching(&mut self) { ... }
    fn will_become_active(&mut self) { ... }
    fn did_become_active(&mut self) { ... }
    fn will_resign_active(&mut self) { ... }
    fn did_resign_active(&mut self) { ... }
    fn should_terminate(&self) -> bool { ... }
    fn will_terminate(&mut self) { ... }
    fn _window_will_close(&self, _window_id: usize) { ... }
}
Expand description

Each platform tends to have their own startup routine, their own runloop, and so on. Alchemy recognizes this and provides an AppDelegate that receives events at a system level and allows the user to operate within the established framework per-system.

Provided Methods§

Source

fn will_finish_launching(&mut self)

Fired when an Application is about to finish launching.

Source

fn did_finish_launching(&mut self)

Fired when an Application has finished launching - this is a good place to, say, show your window.

Source

fn will_become_active(&mut self)

Fired when an Application will become active.

Source

fn did_become_active(&mut self)

Fired when an Application became active.

Source

fn will_resign_active(&mut self)

Fired when an Application will resign active. You can use this to, say, persist resources or state.

Source

fn did_resign_active(&mut self)

Fired when an Application has resigned active.

Source

fn should_terminate(&self) -> bool

Fired when an Application is going to terminate. You can use this to, say, instruct the system to “wait a minute, lemme finish”.

Source

fn will_terminate(&mut self)

Fired when the Application has determined “no, you’re done, stop the world”.

Source

fn _window_will_close(&self, _window_id: usize)

A private trait method that you shouldn’t call. This may change or disappear in later releases. Do not rely on this.

Implementors§