#include <memory>
int main() {
auto renderer_focusable =
Renderer([](
bool focused) {
if (focused)
else
});
auto renderer_non_focusable =
Renderer([&] {
return text(
"~~~~~ Non Focusable renderer() ~~~~~");
});
auto button =
Button(
"Wrapped quit button", screen.ExitLoopClosure());
auto renderer_wrap =
Renderer(button, [&] {
if (button->Focused())
else
return button->Render();
});
renderer_focusable,
renderer_non_focusable,
renderer_wrap,
}));
}
static ScreenInteractive FitComponent()
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Element bold(Element)
Use a bold font, for elements with more emphasis.
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Element center(Element)
Center an element horizontally and vertically.
Element text(std::wstring text)
Display a piece of unicode text.
Element border(Element)
Draw a border around the element.
Decorator color(Color)
Decorate using a foreground color.