34 explicit Impl(std::function<
Element()> render)
35 : render_(std::move(render)) {}
37 std::function<
Element()> render_;
40 return Make<Impl>(std::move(render));
65 renderer->Add(std::move(child));
89 explicit Impl(std::function<
Element(
bool)> render)
90 : render_(std::move(render)) {}
94 bool Focusable()
const override {
return true; }
95 bool OnEvent(
Event event)
override {
97 if (!CaptureMouse(event)) {
108 std::function<
Element(
bool)> render_;
110 return Make<Impl>(std::move(render));
128 return [decorator](
Component component) {
129 return Renderer(component, [component, decorator] {
130 return component->Render() | decorator;
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
std::shared_ptr< Node > Element
std::function< Element(Element)> ElementDecorator
std::shared_ptr< ComponentBase > Component
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
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 ...