FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
examples/dom/gridbox.cpp
Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
2// このソースコードの使用は、LICENSE ファイルにある MIT ライセンスによって管理されています。
3#include <stdio.h> // for getchar
4#include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
5#include <ftxui/screen/screen.hpp> // for Screen
6#include <memory> // for allocator, shared_ptr
7
8#include "ftxui/dom/node.hpp" // for Render
9#include "ftxui/screen/color.hpp" // for ftxui
10
11int main() {
12 using namespace ftxui;
13 auto cell = [](const char* t) { return text(t) | border; };
14 auto document = //
15 gridbox({
16 {
17 cell("north-west"),
18 cell("north"),
19 cell("north-east"),
20 },
21 {
22 cell("center-west"),
23 gridbox({
24 {
25 cell("center-north-west"),
26 cell("center-north-east"),
27 },
28 {
29 cell("center-south-west"),
30 cell("center-south-east"),
31 },
32 }),
33 cell("center-east"),
34 },
35 {
36 cell("south-west"),
37 cell("south"),
38 cell("south-east"),
39 },
40 });
41 auto screen = Screen::Create(Dimension::Fit(document));
42 Render(screen, document);
43 screen.Print();
44 getchar();
45
46 return 0;
47}
Element border(Element child)
要素の周囲にボーダーを描画します。
FTXUI ftxui:: 名前空間
Definition animation.hpp:9