[][src]Enum druid::LifeCycle

pub enum LifeCycle {
    WidgetAdded,
    Size(Size),
    AnimFrame(u64),
    HotChanged(bool),
    FocusChanged(bool),
    Internal(InternalLifeCycle),
}

Application life cycle events.

Variants

WidgetAdded

Sent to a Widget when it is added to the widget tree. This should be the first message that each widget receives.

Widgets should handle this event in order to do any initial setup.

In addition to setup, this event is also used by the framework to track certain types of important widget state.

Registering children

Container widgets (widgets which use WidgetPod to manage children) must ensure that this event is forwarded to those children. The WidgetPod itself will handle registering those children with the system; this is required for things like correct routing of events.

Participating in focus

Widgets which wish to participate in automatic focus (using tab to change focus) must handle this event and call LifeCycleCtx::register_for_focus.

Size(Size)

Called when the size of the widget changes.

The Size is derived from the Rect that was set with WidgetPod::set_layout_rect.

AnimFrame(u64)

Called at the beginning of a new animation frame.

On the first frame when transitioning from idle to animating, interval will be 0. (This logic is presently per-window but might change to per-widget to make it more consistent). Otherwise it is in nanoseconds.

HotChanged(bool)

Called when the "hot" status changes.

This will always be called before the event that triggered it; that is, when the mouse moves over a widget, that widget will receive LifeCycle::HotChanged before it receives Event::MouseMove.

See is_hot for discussion about the hot status.

FocusChanged(bool)

Called when the focus status changes.

This will always be called immediately after a new widget gains focus. The newly focused widget will receive this with true and the widget that lost focus will receive this with false.

See EventCtx::is_focused for more information about focus.

Internal druid lifecycle event.

This should always be passed down to descendant WidgetPods.

Trait Implementations

impl Clone for LifeCycle[src]

impl Debug for LifeCycle[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> RoundFrom<T> for T

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.