21 auto left_buttons = Container::Horizontal({
22 Button(
"Decrease", [&] { left_count--; }),
23 Button(
"Increase", [&] { left_count++; }),
26 auto right_buttons = Container::Horizontal({
27 Button(
"Decrease", [&] { right_count--; }),
28 Button(
"Increase", [&] { right_count++; }),
33 auto leftpane =
Renderer(left_buttons, [&] {
35 text(
"This is the left control"),
37 text(
"Left button count: " + std::to_string(left_count)),
38 left_buttons->Render(),
43 auto rightpane =
Renderer(right_buttons, [&] {
45 text(
"This is the right control"),
47 text(
"Right button count: " + std::to_string(right_count)),
48 right_buttons->Render(),
56 auto composition = Container::Horizontal({leftpane, rightpane});
58 auto screen = App::FitComponent();
59 screen.Loop(composition);
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
Dibuja un botón. Ejecuta una función cuando se hace clic.
Component Renderer(Component child, std::function< Element()>)
Devuelve un nuevo Component, similar a |child|, pero usando |render| como el evento Component::Render...