[][src]Struct druid::AppDelegate

pub struct AppDelegate<T> { /* fields omitted */ }

A type that provides hooks for handling and modifying top-level events.

The AppDelegate is a struct that is allowed to handle and modify events before they are passed down the widget tree.

It is a natural place for things like window and menu management.

You customize the AppDelegate by passing closures during creation.

Methods

impl<T: Data> AppDelegate<T>[src]

pub fn new() -> Self[src]

Create a new AppDelegate.

pub fn event_handler<F>(self, f: F) -> Self where
    F: Fn(Event, &mut T, &Env, &mut DelegateCtx) -> Option<Event> + 'static, 
[src]

Set the AppDelegate's event handler. This function receives all events, before they are passed down the tree.

The return value of this function will be passed down the tree. This can be the even that was passed in, a different event, or no event. In all cases, the update method will be called as usual.

Auto Trait Implementations

impl<T> !Send for AppDelegate<T>

impl<T> !Sync for AppDelegate<T>

impl<T> Unpin for AppDelegate<T>

impl<T> !UnwindSafe for AppDelegate<T>

impl<T> !RefUnwindSafe for AppDelegate<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>,