mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 04:31:34 +08:00
7b7177b59c
See the [OSC 8 page](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). FTXUI support proposed by @aaleino in [#662](https://github.com/ArthurSonzogni/FTXUI/issues/662). API: ```cpp auto link = text("Click here") | hyperlink("https://github.com/FTXUI") ``` Fixed:https://github.com/ArthurSonzogni/FTXUI/issues/662
36 lines
1.5 KiB
C++
36 lines
1.5 KiB
C++
#include <ftxui/dom/elements.hpp> // for text, operator|, Element, bgcolor, color, blink, bold, dim, inverted, underlined, Fit, hbox
|
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
|
#include <memory> // for allocator
|
|
|
|
#include "ftxui/dom/node.hpp" // for Render
|
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
|
|
|
|
int main() {
|
|
using namespace ftxui;
|
|
// clang-format off
|
|
auto document =
|
|
hbox({
|
|
text("normal") , text(" ") ,
|
|
text("bold") | bold , text(" ") ,
|
|
text("dim") | dim , text(" ") ,
|
|
text("inverted") | inverted , text(" ") ,
|
|
text("underlined") | underlined , text(" ") ,
|
|
text("underlinedDouble") | underlinedDouble , text(" ") ,
|
|
text("blink") | blink , text(" ") ,
|
|
text("strikethrough") | strikethrough , text(" ") ,
|
|
text("color") | color(Color::Blue) , text(" ") ,
|
|
text("bgcolor") | bgcolor(Color::Blue) , text(" ") ,
|
|
text("hyperlink") | hyperlink("https://github.com/ArthurSonzogni/FTXUI"),
|
|
});
|
|
// clang-format on
|
|
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
|
|
Render(screen, document);
|
|
screen.Print();
|
|
|
|
return 0;
|
|
}
|
|
|
|
// 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.
|