22 auto option = ButtonOption::Animated();
23 option.transform = [](
const EntryState& s) {
46 auto buttons = Container::Vertical({
47 Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
48 Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
52 auto component =
Renderer(buttons, [&] {
56 buttons->Render() |
flex,
61 auto screen = App::FitComponent();
62 screen.Loop(component);
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
クリックすると関数を実行するボタンを描画します。
Component Renderer(Component child, std::function< Element()>)
|child| に似た、|render| をComponent::Render()イベントとして 使用する新しいComponentを返します。
Element text(std::string_view text)
UTF8エンコードされたユニコードテキストを表示します。
Element flex(Element child)
子要素をコンテナに残されたスペースに比例して拡大させます。
Element bold(Element child)
より強調したい要素に、太字フォントを使用します。
Element vbox(Elements children)
要素を縦に一つずつ表示するコンテナ。