mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-10-31 00:17:44 +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
26 lines
810 B
C++
26 lines
810 B
C++
#include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
|
|
#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 ftxui
|
|
|
|
int main() {
|
|
using namespace ftxui;
|
|
auto document = //
|
|
hbox({
|
|
text("This text is an "),
|
|
text("hyperlink") | hyperlink("https://www.google.com"),
|
|
text(". Do you like it?"),
|
|
});
|
|
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.
|