19void Post(std::function<
void()> f) {
21 screen->Post(std::move(f));
57 if (
event.is_mouse()) {
87 std::function<
void()> on_enter,
92 std::function<
void()> on_enter,
106 if (
event.is_mouse()) {
191 [on_change] { on_change(
true); },
192 [on_change] { on_change(
false); }
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
virtual Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::C...
virtual bool OnEvent(Event)
Called in response to an event.
static ScreenInteractive * Active()
Return the currently active screen, or null if none.
std::shared_ptr< Node > Element
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< ComponentBase > Component
Component Hoverable(Component component, bool *hover)
Wrap a component. Gives the ability to know if it is hovered by the mouse.
Decorator reflect(Box &box)
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
std::function< Component(Component)> ComponentDecorator
Represent an event. It can be key press event, a terminal resize, or more ...