tortoise 0.1.0

Build terminal user interfaces in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tortoise::{event::Event, screen::Screen, style::Style};

fn main() {
	let mut screen = Screen::open().unwrap();
	screen.hide_cursor().unwrap();
	loop {
		let event = screen.listen().unwrap();
		match event {
			Event::Char('q') => break,
			_ => {
				screen.clear_row(0);
				screen.put_str(0, 0, Style::default(), &format!("{}", event));
				screen.flush().unwrap();
			}
		}
	}
}