#include <memory>
#include <string>
#include <vector>
struct CheckboxState {
bool checked;
};
int main(int argc, const char* argv[]) {
std::vector<CheckboxState> states(30);
auto container = Container::Vertical({});
for (int i = 0; i < 30; ++i) {
states[i].checked = false;
container->Add(
Checkbox(
"Checkbox" + std::to_string(i), &states[i].checked));
}
auto renderer =
Renderer(container, [&] {
});
auto screen = ScreenInteractive::FitComponent();
screen.Loop(renderer);
return 0;
}
Component Checkbox(ConstStringRef label, bool *checked, Ref< CheckboxOption > option={})
Draw checkable element.
Element vscroll_indicator(Element)
Add a filter that will invert the foreground and the background colors.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Decorator size(Direction, Constraint, int value)
Apply a constraint on the size of an element.
Element border(Element)
Draw a border around the element.