Cat Approved TUIs, meow~
  • C++ 98.4%
  • Makefile 1.6%
Find a file
2023-10-31 17:55:06 +01:00
.github/ISSUE_TEMPLATE Update issue templates 2023-09-04 10:32:16 +02:00
examples 0.2.0 - new file structure! 2023-09-19 17:33:00 +02:00
inc switched to make file 2023-10-31 17:55:06 +01:00
src switched to make file 2023-10-31 17:55:06 +01:00
.gitignore fixed CatString methods 2023-10-28 11:07:06 +02:00
LICENSE Initial commit 2023-08-19 21:54:34 +02:00
Makefile switched to make file 2023-10-31 17:55:06 +01:00
README.md switched to make file 2023-10-31 17:55:06 +01:00

cat 0.2.0

Cat Approved TUI - a TUI framework, meow~

Requirements

  • C++ 20
  • make
  • ncurses

Installation

$ git clone https://codeberg.org/labricecat/cat
$ cd cat
$ mkdir build
$ sudo make install
$ g++      -lncurses -lcatui <source...> -std=c++20
$ # or ...
$ clang++  -lncurses -lcatui <source...> -std=c++20

Usage

For details read the documentation.

Example

This is an example from examples/example.cpp

#include <cat/cat.hpp> // include the framework

int main() {
        // execute some code next frame once 
    cat::async(cat::Priority::NORMAL, []() {
            // creates a new window at 0,0 with the resolution 30x10 
        cat::Window* my_window = cat::new_window({0,0},{30,10});
            // draws some text to the window 
        my_window->draw("Hello, World!");
            
            // mark this window to be redrawn next frame
        my_window->redraw();
        
            // set a window key event 
        my_window->set_key('o', [=]() {
                // clears the screen
                // It's adviced to avoid this function to avoid lag
            my_window->clear(); 
                // draws a c formatted string in the color red 
            my_window->draw(cat::effect::red + "Oh a %s event!", "key"); 
                // redraw ...
            my_window->redraw();
        });
    });
        // execute some code next frame once, with higher priority
    cat::async(cat::Priority::HIGH, []() {
            // set a global key event
        cat::set_keymap('q', []() {
                // emit to the framework to shut down
            cat::signals::emit(
                    cat::signals::quit_signal
                );
        });
    });
        
        // start the framework with some settings 
    cat::cycle(cat::Settings{ .color = true, });
}