22 : main_(std::move(main)),
23 modal_(std::move(modal)),
24 show_modal_(show_modal) {
30 selector_ = *show_modal_;
31 auto document = main_->Render();
41 bool OnEvent(
Event event)
override {
42 selector_ = *show_modal_;
48 const bool* show_modal_;
49 int selector_ = *show_modal_;
51 return Make<Impl>(main, modal, show_modal);
59 return [modal, show_modal](
Component main) {
60 return Modal(std::move(main), modal, show_modal);
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
virtual bool OnEvent(Event)
Called in response to an event.
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
Element clear_under(Element element)
Before drawing |child|, clear the pixels below. This is useful in.
std::shared_ptr< Node > Element
std::shared_ptr< ComponentBase > Component
Component Modal(Component main, Component modal, const bool *show_modal)
Element center(Element)
Center an element horizontally and vertically.
Element dbox(Elements)
Stack several element on top of each other.
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 ...