17 std::vector<std::string> toggle_1_entries = {
21 std::vector<std::string> toggle_2_entries = {
25 std::vector<std::string> toggle_3_entries = {
29 std::vector<std::string> toggle_4_entries = {
35 int toggle_1_selected = 0;
36 int toggle_2_selected = 0;
37 int toggle_3_selected = 0;
38 int toggle_4_selected = 0;
51 auto renderer =
Renderer(container, [&] {
53 text(
"Choose your options:"),
55 hbox(
text(
" * Poweroff on startup : "), toggle_1->Render()),
56 hbox(
text(
" * Out of process : "), toggle_2->Render()),
57 hbox(
text(
" * Price of the information : "), toggle_3->Render()),
58 hbox(
text(
" * Number of elements : "), toggle_4->Render()),
63 screen.Loop(renderer);
static ScreenInteractive TerminalOutput()
Component Toggle(ConstStringListRef entries, int *selected)
An horizontal list of elements. The user can navigate through them.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Element text(std::wstring text)
Display a piece of unicode text.
Element vbox(Elements)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.
std::shared_ptr< ComponentBase > Component
Element hbox(Elements)
A container displaying elements horizontally one by one.