semtext 0.1.0

Terminal UI Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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())
}