pub struct SelectionContainerScope { /* private fields */ }Expand description
A SelectionContainer and its builder.
Implementations§
Source§impl SelectionContainerScope
impl SelectionContainerScope
Sourcepub fn on_pointer(
self,
kinds: PointerKinds,
handler: impl FnMut(PointerEvent) + 'static,
) -> Self
pub fn on_pointer( self, kinds: PointerKinds, handler: impl FnMut(PointerEvent) + 'static, ) -> Self
Subscribes the node to the kinds of pointer input in kinds. The handler runs
on the same call as the input; calling consume on the event keeps it from
the nearest subscribed ancestor and from the Renderer’s own handling.
A node that never calls this has no pointer input at all, and costs nothing.
Source§impl SelectionContainerScope
impl SelectionContainerScope
Sourcepub fn on_click(self, handler: impl FnMut() + 'static) -> Self
pub fn on_click(self, handler: impl FnMut() + 'static) -> Self
Makes the container a button. The Renderer gives it keyboard focus, runs the handler on a click and on Enter or Space, announces it to assistive technology as a button, and shows hover, pressed and focus state.
A container that never calls this is not a control and costs nothing.
Source§impl SelectionContainerScope
impl SelectionContainerScope
Sourcepub fn on_focus_gained(self, handler: impl FnMut() + 'static) -> Self
pub fn on_focus_gained(self, handler: impl FnMut() + 'static) -> Self
Runs when this node or a descendant inside it gains keyboard focus.
Sourcepub fn on_focus_lost(self, handler: impl FnMut() + 'static) -> Self
pub fn on_focus_lost(self, handler: impl FnMut() + 'static) -> Self
Runs when this node and its descendants lose keyboard focus.
Sourcepub fn on_key_down(self, handler: impl FnMut(KeyEvent) + 'static) -> Self
pub fn on_key_down(self, handler: impl FnMut(KeyEvent) + 'static) -> Self
Sees each key pressed while this node or a descendant inside it holds focus;
calling consume on the event keeps the Renderer from acting on it.
Sourcepub fn on_key_up(self, handler: impl FnMut(KeyEvent) + 'static) -> Self
pub fn on_key_up(self, handler: impl FnMut(KeyEvent) + 'static) -> Self
Sees each key released while this node or a descendant inside it holds focus.
Sourcepub fn focus_handle(self, handle: &FocusHandle) -> Self
pub fn focus_handle(self, handle: &FocusHandle) -> Self
Binds handle to this node, so handle.request() puts keyboard focus here.