#include <functional>
#include <iostream>
#include <string>
#include <vector>
return Renderer(child, [child] { return child->Render() | border; });
}
int main(int argc, const char* argv[]) {
std::vector<std::string> entries = {
"entry 1",
"entry 2",
"entry 3",
};
int menu_1_selected = 0;
int menu_2_selected = 0;
auto menu_1 =
Radiobox(&entries, &menu_1_selected);
auto menu_2 =
Radiobox(&entries, &menu_2_selected);
menu_1 = Border(menu_1);
menu_2 = Border(menu_2);
bool menu_1_show = false;
bool menu_2_show = false;
auto layout = Container::Vertical({
Maybe(menu_1, &menu_1_show),
Maybe(menu_2, &menu_2_show),
});
auto screen = ScreenInteractive::TerminalOutput();
screen.Loop(layout);
}
Component Checkbox(ConstStringRef label, bool *checked, Ref< CheckboxOption > option={})
Draw checkable element.
Component Radiobox(ConstStringListRef entries, int *selected_, Ref< RadioboxOption > option={})
A list of element, where only one can be selected.
std::shared_ptr< ComponentBase > Component
Component Maybe(Component child, bool *show)