17 std::array<bool, 30> states;
19 auto container = Container::Vertical({});
20 for (
int i = 0; i < 30; ++i) {
22 container->Add(
Checkbox(
"Checkbox" + std::to_string(i), &states[i]));
25 auto renderer =
Renderer(container, [&] {
26 return container->Render() | vscroll_indicator | frame |
30 auto screen = App::FitComponent();
31 screen.Loop(renderer);
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component Checkbox(ConstStringRef label, bool *checked, CheckboxOption options=CheckboxOption::Simple())
Draw checkable element.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Apply a constraint on the size of an element.
Element border(Element child)
Draw a border around the element.
The FTXUI ftxui:: namespace.