FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
examples/dom/dbox.cpp
浏览该文件的文档.
1// 版权所有 2020 Arthur Sonzogni。保留所有权利。
2// 本源代码受 MIT 许可证的约束,可在 LICENSE 文件中找到。
3#include <ftxui/dom/elements.hpp> // for text, operator|, border, Element, vbox, center, Fit, dbox
4#include <ftxui/screen/screen.hpp> // for Full, Screen
5#include <memory> // for allocator
6
7#include "ftxui/dom/node.hpp" // for Render
8#include "ftxui/screen/color.hpp" // for ftxui
9
10int main() {
11 using namespace ftxui;
12 auto document = dbox({
13 vbox({
14 text("line_1"),
15 text("line_2"),
16 text("line_3"),
17 text("line_4"),
18 text("line_5"),
19 }) | border,
20 text("overlay") | border | center,
21 });
22 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
23 Render(screen, document);
24
25 screen.Print();
26
27 return 0;
28}
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase