Files
FTXUI/examples/dom/vbox_hbox.cpp

41 lines
1.1 KiB
C++
Raw Normal View History

2023-08-19 13:56:36 +02:00
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <stdio.h> // for getchar
#include <ftxui/dom/elements.hpp> // for filler, text, hbox, vbox
#include <ftxui/screen/screen.hpp> // for Full, Screen
#include <memory> // for allocator
2021-05-01 20:40:35 +02:00
2022-01-07 11:03:54 +01:00
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for ftxui
2018-09-18 08:48:40 +02:00
int main() {
using namespace ftxui;
auto document = //
vbox({
hbox({
text("north-west"),
filler(),
text("north-east"),
}),
filler(),
hbox({
filler(),
text("center"),
filler(),
}),
filler(),
hbox({
text("south-west"),
filler(),
text("south-east"),
}),
});
2019-01-26 21:52:55 +01:00
auto screen = Screen::Create(Dimension::Full());
Render(screen, document);
2021-03-21 22:54:39 +01:00
screen.Print();
getchar();
2018-09-18 08:48:40 +02:00
return 0;
}