Skip to content

Aintdev/CroissanTUI

Repository files navigation

Warning

This project is a work in progress and should not be considered production-ready.

CroissanTUI

A C++ TUI framework inspired by tkinter, easy to learn, fast to code, beginner friendly.

MIT License Dev build Build from source: C++20 Precompiled .lib: C++17


Resources


CroissanTUI is a easy-to-use C++ Text User Interface Framework, written entirely from scratch and inspired by Python's tkinter for cross-platform applications. It has easy usage and a gentle learning curve, making it perfect for smaller projects.

Key features:

  • KWARGs: instead of structs like ButtonConfig to configure Widgets, CroissanTUI uses keyword arguments thats inspired by Python's keyword arguments.
  • Text Modifiers: different characters and words inside a Label can be rendered with different colors without having to create separate widgets, using TextStreams as a way to store text data.
    ctui::Label(&parent, 
        text << "Normal text | " 
            << Color::Red << "Red Text | " 
            << GraphicMod::Italic << "Italic red text |" 
            << GraphicMod::ResetAll << "Normal text") // <- Argument evaluates to a TextStream
  • Live Updates via Lambdas: TextStream tokens can also be std::function<std::string()>, letting a Label display live values by capturing a reference to an outside object — e.g. [&score]() { return std::to_string(score); } so the text updates automatically whenever the referenced value changes.
    ctui::Label(&parent, 
        text << "Score: " 
            << [&score]() { return std::string(score); },
        align = End);

Requirements

Task C++ Standard
Build from source C++20
Use the precompiled library C++17

Note: The library implementation uses C++20 features internally. The public API is compatible with C++17, so applications linking against the precompiled library only require a C++17 compiler.

Installation

Quick Start

About

TUI Framework in the style of tkinter

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors