Crate semtext

Source
Expand description

Semtext is a Rust library for building text user interfaces, or TUIs.

§Example

use semtext::{grid_area, input::Action, widget::Label, Screen, Widget};

async fn async_main() -> Result<(), Box<dyn std::error::Error>> {
    let mut screen = Screen::new()?;
    let a = Label::new("Hello!").into_button();
    let grid = grid_area!(
        [. . .]
        [. a .]
        [. . .]
    )?;
    while screen.step(&grid).await? != Action::Quit() {}
    Ok(())
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    futures::executor::block_on(async_main())
}

Modules§

input
Keyboard and mouse input handling
layout
User interface layout
text
Text styles and themes
widget
User Interface Widgets

Macros§

grid_area
Lay out Widgets into a GridArea

Structs§

Screen
Terminal screen

Enums§

Error
Enum of semtext errors

Traits§

Widget
User interface component