22 Button(
"Decrease", [&] { left_count--; }),
23 Button(
"Increase", [&] { left_count++; }),
27 Button(
"Decrease", [&] { right_count--; }),
28 Button(
"Increase", [&] { right_count++; }),
33 auto leftpane =
Renderer(left_buttons, [&] {
35 text(
"This is the left control"),
37 text(
"Left button count: " + std::to_string(left_count)),
43 auto rightpane =
Renderer(right_buttons, [&] {
45 text(
"This is the right control"),
47 text(
"Right button count: " + std::to_string(right_count)),
48 right_buttons->Render(),
59 screen.Loop(composition);
static ScreenInteractive FitComponent()
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Element text(std::wstring text)
Display a piece of unicode text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element vbox(Elements)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.