[−][src]Enum druid::LifeCycle
Application life cycle events.
Unlike Event
s, LifeCycle
events are generated by Druid, and
may occur at different times during a given pass of the event loop. The
LifeCycle::WidgetAdded
event, for instance, may occur when the app
first launches (during the handling of Event::WindowConnected
) or it
may occur during update
cycle, if some widget has been added there.
Similarly the LifeCycle::Size
method occurs during layout
, and
LifeCycle::HotChanged
can occur both during event
(if the mouse
moves over a widget) or during layout
, if a widget is resized and
that moves it under the mouse.
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.
This will be called after Widget::layout
, if the Size
returned
by the widget differs from its previous size.
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.
Implementations
impl LifeCycle
[src]
pub fn should_propagate_to_hidden(&self) -> bool
[src]
Whether this event should be sent to widgets which are currently not visible (for example the hidden tabs in a tabs widget).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LifeCycle
[src]
impl Send for LifeCycle
[src]
impl Sync for LifeCycle
[src]
impl Unpin for LifeCycle
[src]
impl UnwindSafe for LifeCycle
[src]
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,
pub 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
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,