FTXUI
6.1.9
C++ functional terminal UI.
Chargement...
Recherche...
Aucune correspondance
examples/dom/gridbox.cpp
Aller à la documentation de ce fichier.
1
// Copyright 2021 Arthur Sonzogni. Tous droits réservés.
2
// L'utilisation de ce code source est régie par la licence MIT qui peut être trouvée dans
3
// le fichier LICENSE.
4
#include <stdio.h>
// pour getchar
5
#include <
ftxui/dom/elements.hpp
>
// pour Elements, gridbox, Fit, operator|, text, border, Element
6
#include <
ftxui/screen/screen.hpp
>
// pour Screen
7
#include <memory>
// pour allocator, shared_ptr
8
9
#include "
ftxui/dom/node.hpp
"
// pour Render
10
#include "
ftxui/screen/color.hpp
"
// pour 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
screen
auto screen
Definition
composition.cpp:56
elements.hpp
main
int main()
Definition
examples/component/button.cpp:33
Render
void Render(Screen &screen, const Element &element)
Affiche un élément sur un ftxui::Screen.
Definition
node.cpp:83
ftxui
L'espace de noms FTXUI ftxui::
Definition
animation.hpp:10
node.hpp
screen.hpp