FTXUI
6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
examples/dom/gridbox.cpp
浏览该文件的文档.
1
// 版权所有 2021 Arthur Sonzogni。保留所有权利。
2
// 此源代码的使用受 MIT 许可协议的约束,该协议可在
3
// LICENSE 文件中找到。
4
#include <stdio.h>
// 用于 getchar
5
#include <
ftxui/dom/elements.hpp
>
// 用于 Elements, gridbox, Fit, operator|, text, border, Element
6
#include <
ftxui/screen/screen.hpp
>
// 用于 Screen
7
#include <memory>
// 用于 allocator, shared_ptr
8
9
#include "
ftxui/dom/node.hpp
"
// 用于 Render
10
#include "
ftxui/screen/color.hpp
"
// 用于 ftxui
11
12
int
main
() {
13
using namespace
ftxui
;
14
auto
cell = [](
const
char
* t) {
return
text(t) |
border
; };
15
auto
document =
//
16
gridbox({
17
{
18
cell(
"north-west"
),
19
cell(
"north"
),
20
cell(
"north-east"
),
21
},
22
{
23
cell(
"center-west"
),
24
gridbox({
25
{
26
cell(
"center-north-west"
),
27
cell(
"center-north-east"
),
28
},
29
{
30
cell(
"center-south-west"
),
31
cell(
"center-south-east"
),
32
},
33
}),
34
cell(
"center-east"
),
35
},
36
{
37
cell(
"south-west"
),
38
cell(
"south"
),
39
cell(
"south-east"
),
40
},
41
});
42
auto
screen = Screen::Create(Dimension::Fit(document));
43
Render(screen, document);
44
screen.Print();
45
getchar();
46
47
return
0;
48
}
color.hpp
elements.hpp
main
int main()
定义
examples/component/button.cpp:33
border
Element border(Element child)
在元素周围绘制边框。
定义
src/ftxui/dom/border.cpp:225
ftxui
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
定义
animation.hpp:9
node.hpp
screen.hpp