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)),
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});
59 screen.Loop(composition);
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.