[−][src]Struct druid::AppDelegate
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]
F: Fn(Event, &mut T, &Env, &mut DelegateCtx) -> Option<Event> + 'static,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,