2025-03-23 01:03:43 +08:00
|
|
|
// Copyright 2025 Arthur Sonzogni. All rights reserved.
|
|
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
|
|
// the LICENSE file.
|
2025-05-16 02:54:42 +08:00
|
|
|
#ifndef FTXUI_BUILD_MODULES
|
2025-03-23 01:03:43 +08:00
|
|
|
#include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
|
|
|
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
2025-05-16 02:54:42 +08:00
|
|
|
#endif
|
|
|
|
|
2025-03-23 01:03:43 +08:00
|
|
|
#include <memory> // for allocator
|
|
|
|
|
2025-05-16 02:54:42 +08:00
|
|
|
#ifndef FTXUI_BUILD_MODULES
|
2025-03-23 01:03:43 +08:00
|
|
|
#include "ftxui/dom/node.hpp" // for Render
|
|
|
|
#include "ftxui/screen/color.hpp" // for ftxui
|
2025-05-16 02:54:42 +08:00
|
|
|
#else
|
|
|
|
import ftxui.dom;
|
|
|
|
import ftxui.screen;
|
|
|
|
#endif
|
2025-03-23 01:03:43 +08:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
using namespace ftxui;
|
|
|
|
auto document = hbox({
|
|
|
|
text("This text is "),
|
|
|
|
text("italic") | italic,
|
|
|
|
text(". Do you like it?"),
|
|
|
|
});
|
|
|
|
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
|
|
|
|
Render(screen, document);
|
|
|
|
screen.Print();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|