#include <memory>
#include <string>
auto option = ButtonOption::Animated();
auto element = text(s.label);
if (s.focused) {
element |= bold;
}
return element | center | borderEmpty | flex;
};
return option;
}
int value = 50;
auto btn_dec_01 = Button(
"-1", [&] { value -= 1; },
Style());
auto btn_inc_01 = Button(
"+1", [&] { value += 1; },
Style());
auto btn_dec_10 = Button(
"-10", [&] { value -= 10; },
Style());
auto btn_inc_10 = Button(
"+10", [&] { value += 10; },
Style());
int row = 0;
auto buttons = Container::Vertical({
Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
});
auto component = Renderer(buttons, [&] {
text("value = " + std::to_string(value)),
separator(),
buttons->Render() | flex,
}) |
flex | border;
});
auto screen = ScreenInteractive::FitComponent();
return 0;
}
Element vbox(Elements children)
Un contenedor que muestra elementos verticalmente uno por uno.
El espacio de nombres ftxui:: de FTXUI.
Argumentos para la transformación de |ButtonOption|, |CheckboxOption|, |RadioboxOption|,...