FTXUI 7.0.3
C++ functional terminal UI.
Loading...
Searching...
No Matches
介紹

Table of Contents

Demo image

FTXUI 是一個簡單的跨平台 C++ 函式庫,用於基於終端的使用者介面!

特色

  • 函式風格。靈感來自 1 和 React
  • 無相依套件
  • **跨平台**。
  • 簡單優雅的語法(在我看來)
  • 鍵盤與滑鼠導覽。
  • 支援 UTF8 與 全形字元(→ 测试)
  • 支援動畫。Demo 1、Demo 2
  • 支援繪圖。Demo
  • 透過安裝與快速上手指南學習。
  • 多種建置系統與套件:
  • 良好實踐:文件、測試、模糊測試(fuzzers)、效能測試、自動化 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();
}
FTXUI ftxui:: 命名空間
Definition animation.hpp:11
std::shared_ptr< Node > Element
Definition elements.hpp:25

預期輸出:

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

支援的平台

  • Linux
  • MacOS
  • Windows
  • WebAssembly
下一頁
Getting Started