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// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include <stdio.h> // for getchar
5#include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
6#include <ftxui/screen/screen.hpp> // for Screen
7#include <memory> // for allocator, shared_ptr
8
9#include "ftxui/dom/node.hpp" // for Render
10#include "ftxui/screen/color.hpp" // for 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()
Definition examples/dom/gridbox.cpp:12
ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
node.hpp
screen.hpp