Function zng_wgt::on_info_init

source ·
pub fn on_info_init(
    child: impl UiNode,
    handler: impl WidgetHandler<OnNodeOpArgs>
) -> impl UiNode
Expand description

P Widget info is now available.

This event fires after the first UiNode::info is built, after UiNode::init. This event can be used when some widget initialization needs to happen, but the widget must be in the WidgetInfoTree for it to work.

§Handlers

This property accepts any WidgetHandler, including the async handlers. Use one of the handler macros, hn!, hn_once!, async_hn! or async_hn_once!, to declare a handler closure.

§Async

The async handlers spawn a task that is associated with the widget, it will only update when the widget updates, so the task pauses when the widget is deinited, and is canceled when the widget is dropped.