[−][src]Enum druid::LifeCycle
Application life cycle events.
Variants
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(InternalLifeCycle)
Internal druid lifecycle event.
This should always be passed down to descendant WidgetPod
s.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LifeCycle
impl Send for LifeCycle
impl Sync for LifeCycle
impl Unpin for LifeCycle
impl UnwindSafe for LifeCycle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,