FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
简介

Demo image

FTXUI 是一个用于终端用户界面的简单跨平台 C++ 库!

特性

  • 函数式风格。灵感来自于 1React
  • 无依赖
  • **跨平台**。
  • 简单优雅的语法(我个人认为)
  • 键盘和鼠标导航。
  • 支持 UTF8全角字符 (→ 测试)
  • 支持动画。 演示 1演示 2
  • 支持绘图。 演示
  • 通过 示例 和 教程 学习
  • 多种构建系统和包:
  • 良好实践:文档、测试、模糊测试、性能测试、自动化 CI、自动化打包等...

示例

#include <iostream>
int main() {
using namespace ftxui;
// Create a simple document with three text elements.
Element document = hbox({
text("left") | border,
text("middle") | border | flex,
text("right") | border,
});
// Create a screen with full width and height fitting the document.
auto screen = Screen::Create(
Dimension::Full(), // Width
Dimension::Fit(document) // Height
);
// Render the document onto the screen.
Render(screen, document);
// Print the screen to the console.
screen.Print();
}
Element border(Element child)
在元素周围绘制边框。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
std::shared_ptr< Node > Element

预期输出:

┌────┐┌────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└────────────────────────────────────┘└─────┘

支持的平台

  • Linux
  • MacOS
  • Windows
  • WebAssembly
下一页
开始