unsegen

unsegen is a library facilitating the creation of text user interface (TUI) applications akin to ncurses. Currently, unsegen only provides a Rust interface.

Overview

The library consists of four modules:

The following libraries are built on top of unsegen and provide higher level functionality:

Getting Started

unsegen is available on crates.io. You can install it by adding this line to your Cargo.toml:

toml unsegen = "0.0.1"

Examples

There are examples at the top of each modules' documentation which should be sufficient to get you going.

For a fully fledged application using unsegen, you can have a look at ugdb, which was developed alongside unsegen and the primary motivation for it.

Screenshots

Here is a screenshot of ugdb, which is implemented on top of unsegen.

((TODO))

Some notes on implementation

For simplicity, layouting is done in every draw call. This, in conjunction with recursive calls to calculate space demand of widgets, leads to not-so-great asymptotic runtime. However, I found this not to be a problem in practice so far. If this is problematic for, please file an issue. There are workarounds (caching the draw-result of widgets) for which convenient wrappers can be implemented in the library, but have not so far.

Licensing

unsegen is released under the MIT license.