FTXUI/examples/dom/separator.cpp

32 lines
1.1 KiB
C++
Raw Normal View History

#include <ftxui/dom/elements.hpp> // for text, center, separator, operator|, flex, Element, vbox, Fit, hbox, border
#include <ftxui/screen/screen.hpp> // for Full, Screen
#include <memory> // for allocator
2021-05-02 02:40:35 +08:00
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
2018-09-20 03:52:25 +08:00
2020-03-23 05:32:44 +08:00
int main(int argc, const char* argv[]) {
using namespace ftxui;
auto document = hbox({
text("left-column"),
separator(),
vbox({
center(text("right-top")) | flex,
separator(),
center(text("bottom-bottom")),
}) | flex,
separator(),
text("right-column"),
}) |
border;
2019-01-27 04:52:55 +08:00
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
Render(screen, document);
2021-03-22 05:54:39 +08:00
screen.Print();
2018-09-20 03:52:25 +08:00
return 0;
}
2020-09-06 19:46:56 +08: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.