Skip to main content

Focusable

Trait Focusable 

Source
pub trait Focusable: Component {
    // Required methods
    fn focused(&self) -> bool;
    fn set_focused(&mut self, focused: bool);
}
Expand description

Extension of Component for elements that can receive keyboard focus.

Focus is managed by TUI; only the focused component receives input events.

Required Methods§

Source

fn focused(&self) -> bool

Returns true when this component currently has focus.

Source

fn set_focused(&mut self, focused: bool)

Set or clear the focused state.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§