Based on FTXUI, TUIKit is a modern C++ framework designed to build rich and interactive Terminal User Interfaces (TUIs). Inspired by the simplicity and power of the Qt framework, TUIKit aims to provide a familiar development experience for creating command-line applications, especially suited for scientific and engineering projects.
- Hierarchical Widgets: Utilize a structured hierarchy of UI components (
TUIWidget,TUIForm,TUIMenu, etc.). - Event Handling: Manage user interactions through a signal/slot-like mechanism or callbacks.
- Automatic Layouts: Employ flexible layout managers (
TUIVBox,TUIHBox) for responsive UI design. - Advanced Theming: Customize colors, borders, and styles to create visually appealing interfaces.
Based on the examples/main.cpp and the current codebase, the following core components are implemented and functional:
TUIApp: The entry point for the application.TUIWidget: Base class for all UI components.TUILabel: Displays static text.TUITextField: Editable single-line text input.TUIButton: Interactive button with click events and icon support.TUIMenu: Vertical list of selectable options.TUICheckBox: Simple toggle checkbox.TUIRadioBox: Group of exclusive radio buttons.TUIComboBox: Dropdown list for selection.TUISlider: Horizontal slider for continuous value selection.TUIToolbar: A bar for action buttons.TUIForm: Organizes input fields with labels.TUIGroupBox: Groups related widgets with an optional title and border.TUITabWidget: Organizes content into multiple tabs.TUIStatusBar: Displays status messages at the bottom of the application.
- CMake (version 3.15 or higher)
- A C++17 compatible compiler (e.g., Clang, GCC)
-
Clone the repository:
git clone https://github.com/skhelladi/TUIKit.git cd TUIKit -
Create a build directory and configure CMake:
mkdir build cd build cmake .. -
Build the project:
cmake --build .
After a successful build, you can run the example application:
./build/example_usageHere's a minimal example demonstrating how to create a simple TUI application with TUIKit:
#include "tuikit.h"
#include <memory>
int main() {
TUIKIT::TUIApp app("My Simple TUI App");
auto label = std::make_shared<TUIKIT::TUILabel>("Hello from TUIKit!");
auto button = std::make_shared<TUIKIT::TUIButton>("Click Me!");
button->onClick([&app]() {
app.show_message("Button Clicked!", "Info");
});
auto main_layout = std::make_shared<TUIKIT::TUIVBoxLayout>();
main_layout->addWidget(label);
main_layout->addWidget(button);
app.setMainWidget(main_layout);
return app.exec();
}Contributions are welcome! Please refer to the CONTRIBUTING.md file (to be created) for guidelines on how to contribute to TUIKit.
This project is licensed under the MIT License - see the LICENSE file for details.