18 std::function<
void()> exit) {
19 auto component = Container::Vertical({
26 text(
"Main component"),
40 std::function<
void()> hide_modal) {
41 auto component = Container::Vertical({
48 text(
"Modal component "),
58int main(
int argc,
const char* argv[]) {
62 bool modal_shown =
false;
65 auto show_modal = [&] { modal_shown =
true; };
66 auto hide_modal = [&] { modal_shown =
false; };
67 auto exit = screen.ExitLoopClosure();
68 auto do_nothing = [&] {};
76 main_component |=
Modal(modal_component, &modal_shown);
78 screen.Loop(main_component);
static ButtonOption Animated()
アニメーションカラーを使用するButtonOptionを作成します。
static ScreenInteractive TerminalOutput()
ターミナル出力の幅に一致し、描画されるコンポーネントの高さに一致するScreenInteractiveを作成します。
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked. (ja: ボタンを描画します。クリックされたときに機能を実行します。)
Component Modal(Component main, Component modal, const bool *show_modal)
Component Renderer(Component child, std::function< Element()>)
|child|に似ていますが、|render|をComponentRender()イベントとして使用する新しいコンポーネントを返します。
Element center(Element)
要素を水平方向および垂直方向に中央揃えします。
Element text(std::wstring text)
ユニコードテキストを表示します。
Element vbox(Elements)
要素を縦に一つずつ表示するコンテナ。
Component ModalComponent(std::function< void()> do_nothing, std::function< void()> hide_modal)
Component MainComponent(std::function< void()> show_modal, std::function< void()> exit)
std::shared_ptr< Node > Element
std::shared_ptr< ComponentBase > Component