Trait AppDelegate

Source
pub trait AppDelegate<State = ()>
where State: 'static,
{ // Provided methods fn did_launch(&mut self, state: &mut State) { ... } fn will_show_window(&mut self, window: Window, state: &mut State) { ... } fn configure_main_window( &mut self, state: &mut State, ) -> WindowConfiguration { ... } fn make_content_view( &mut self, state: &mut State, window: Window, ) -> impl View<Self, State> where Self: Sized { ... } fn did_invoke_menu_action( &mut self, item: MenuItem, state: &mut State, window: Window, ) { ... } }
Expand description

A platform-agnostic delegation trait, which will be used as a facade for these native frameworks.

Provided Methods§

Source

fn did_launch(&mut self, state: &mut State)

Called when the underlying native framework finished launching.

Source

fn will_show_window(&mut self, window: Window, state: &mut State)

Called when the underlying native framework finished launching.

Source

fn configure_main_window(&mut self, state: &mut State) -> WindowConfiguration

Called when the main window must be configured. By overloading this function, you can - for example - give the window a name.

Source

fn make_content_view( &mut self, state: &mut State, window: Window, ) -> impl View<Self, State>
where Self: Sized,

Called when the window has been configured, and allows you to set the components that make up your window, such as Labels, Stacks, and Buttons.

Source

fn did_invoke_menu_action( &mut self, item: MenuItem, state: &mut State, window: Window, )

Called when a menu action is invoked.

Implementations on Foreign Types§

Source§

impl AppDelegate for ()

Implementors§