32 explicit Impl(std::function<
Element()> render)
33 : render_(std::move(render)) {}
34 Element OnRender()
override {
return render_(); }
35 std::function<
Element()> render_;
63 renderer->
Add(std::move(child));
87 explicit Impl(std::function<
Element(
bool)> render)
88 : render_(std::move(render)) {}
91 Element OnRender()
override {
return render_(Focused()) | reflect(box_); }
92 bool Focusable()
const override {
return true; }
93 bool OnEvent(
Event event)
override {
95 if (!CaptureMouse(event)) {
106 std::function<
Element(
bool)> render_;
126 return [decorator](
Component component) {
127 return Renderer(component, [component, decorator] {
128 return component->Render() | decorator;
void Add(Component children)
Add a child. @param child The child to be attached.
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Represent an event. It can be key press event, a terminal resize, or more ...
Box is a structure that represents a rectangular area in a 2D space.
The FTXUI ftxui:: namespace.
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< Node > Element
std::function< Element(Element)> ElementDecorator
std::function< Component(Component)> ComponentDecorator
std::shared_ptr< ComponentBase > Component