#include <memory>
#include <string>
int main() {
auto left_count = 0;
auto right_count = 0;
Button(
"Decrease", [&] { left_count--; }),
Button(
"Increase", [&] { left_count++; }),
});
Button(
"Decrease", [&] { right_count--; }),
Button(
"Increase", [&] { right_count++; }),
});
auto leftpane =
Renderer(left_buttons, [&] {
text(
"This is the left control"),
left_buttons->Render(),
}) |
});
auto rightpane =
Renderer(right_buttons, [&] {
text(
"This is the right control"),
right_buttons->Render(),
}) |
});
screen.Loop(composition);
return 0;
}
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.
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
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 border(Element)
Draw a border around the element.
Element vbox(Elements)
A container displaying elements vertically one by one.