zng::widget

Function interactive

source
pub fn interactive(
    child: impl UiNode,
    interactive: impl IntoVar<bool>,
) -> impl UiNode
Expand description

P Defines if any interaction is allowed in the widget and its descendants.

This property sets the interactivity of the widget to BLOCKED when false, widgets with blocked interactivity do not receive any interaction event and behave like a background visual. To probe the widget’s info state use WidgetInfo::interactivity value.

This property enables and disables interaction with the widget and its descendants without causing a visual change like enabled, it also blocks “disabled” interactions such as a different cursor or tooltip for disabled buttons.

Note that this affects the widget where it is set and descendants, to disable interaction only in the widgets inside child use the node::interactive_node.