16 auto back_button =
Button(
"Back", screen.ExitLoopClosure());
17 auto goto_1 =
Button(
"Goto /1", [path] {
Nested(path +
"/1"); });
18 auto goto_2 =
Button(
"Goto /2", [path] {
Nested(path +
"/2"); });
19 auto goto_3 =
Button(
"Goto /3", [path] {
Nested(path +
"/3"); });
20 auto layout = Container::Vertical({
26 auto renderer =
Renderer(layout, [&] {
28 text(
"path: " + path),
37 screen.Loop(renderer);
42 auto button_quit =
Button(
"Quit", screen.ExitLoopClosure());
43 auto button_nested =
Button(
"Nested", [] {
Nested(
""); });
44 screen.Loop(Container::Vertical({
static ScreenInteractive FitComponent()
描画されるコンポーネントの幅と高さに一致するScreenInteractiveを作成します。
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked. (ja: ボタンを描画します。クリックされたときに機能を実行します。)
Component Renderer(Component child, std::function< Element()>)
|child|に似ていますが、|render|をComponentRender()イベントとして使用する新しいコンポーネントを返します。
virtual void Render(Screen &screen)
要素をftxui::Screenに表示します。
Element text(std::wstring text)
ユニコードテキストを表示します。
Element vbox(Elements)
要素を縦に一つずつ表示するコンテナ。
void Nested(std::string path)