32 explicit Impl(std::function<
Element()> render)
33 : render_(std::move(render)) {}
35 std::function<
Element()> render_;
38 return Make<Impl>(std::move(render));
63 renderer->Add(std::move(child));
87 explicit Impl(std::function<
Element(
bool)> render)
88 : render_(std::move(render)) {}
92 bool Focusable()
const override {
return true; }
93 bool OnEvent(
Event event)
override {
95 if (!CaptureMouse(event)) {
106 std::function<
Element(
bool)> render_;
108 return Make<Impl>(std::move(render));
126 return [decorator](
Component component) {
127 return Renderer(component, [component, decorator] {
128 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 ...