#generate #tui #framework #highly #configurable #flexible #umbra

bin+lib umbra-tui

** Umbra TUI Framework: a simple yet highly configurable framework to generate flexible and fast TUIs **

1 unstable release

0.1.0 Aug 27, 2022

#29 in #highly

GPL-3.0 license

19KB
263 lines

Umbra TUI Framework

a simple yet highly configurable framework to generate flexible and fast TUIs


lib.rs:

Umbra TUI Framework

A simple yet highly configurable framework to generate flexible and fast TUIs

Example

use umbra::{IEvent, Umbra};

// NOTE: Umbra assumes that it will be responsible for
// setting up the screen and raw mode
let mut umbra: Umbra = Umbra::new().expect("Umbra error: {0}");
umbra.init().expect("Panic... umbra initialization failed");

loop {
    match umbra.read_event().unwrap() {
        IEvent::Key(key) => print!("Key {:?}", key),
        IEvent::Paste(s) => print!("Paste {0}", s),
        IEvent::FocusGained => print!("Window gained focus"),
        IEvent::FocusLost => print!("Window lost focus"),
    }
    umbra.refresh();
}

Dependencies

~2–13MB
~90K SLoC