#include <memory>
#include <string>
int main() {
auto left_count = 0;
auto right_count = 0;
auto left_buttons = Container::Horizontal({
Button("Decrease", [&] { left_count--; }),
Button("Increase", [&] { left_count++; }),
});
auto right_buttons = Container::Horizontal({
Button("Decrease", [&] { right_count--; }),
Button("Increase", [&] { right_count++; }),
});
auto leftpane = Renderer(left_buttons, [&] {
return vbox({
text("This is the left control"),
separator(),
text("Left button count: " + std::to_string(left_count)),
left_buttons->Render(),
}) |
border;
});
auto rightpane = Renderer(right_buttons, [&] {
return vbox({
text("This is the right control"),
separator(),
text("Right button count: " + std::to_string(right_count)),
right_buttons->Render(),
}) |
border;
});
auto composition = Container::Horizontal({leftpane, rightpane});
auto screen = ScreenInteractive::FitComponent();
screen.Loop(composition);
return 0;
}