14 auto screen = App::Fullscreen();
31 auto renderer =
Renderer(split, [&] {
32 return window(
text(
"Drag the separator with the mouse"),
34 text(
"Min: " + std::to_string(size_min)),
35 text(
"Max: " + std::to_string(size_max)),
36 text(
"Size: " + std::to_string(size)),
38 split->Render() |
flex,
42 screen.Loop(renderer);
Component Renderer(Component child, std::function< Element()>)
|child| に似た、|render| をComponent::Render()イベントとして 使用する新しいComponentを返します。
Element window(Element title, Element content, BorderStyle border=ROUNDED)
要素の周囲にタイトルとボーダーを持つウィンドウを描画します。
Element text(std::string_view text)
UTF8エンコードされたユニコードテキストを表示します。
Element flex(Element child)
子要素をコンテナに残されたスペースに比例して拡大させます。
Element center(Element child)
要素を水平方向および垂直方向に中央揃えします。
Element vbox(Elements children)
要素を縦に一つずつ表示するコンテナ。
Component ResizableSplit(ResizableSplitOption options)
2つのコンポーネント間の分割。