aboutsummaryrefslogtreecommitdiffstats
path: root/examples/basic.rs
blob: 1026834b07006db38ee7c9fb7818d1c5b72b092d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
fn main() {
    let mut tm = textmode::Textmode::new().unwrap();

    tm.move_to(5, 5);
    tm.write_str("foo");
    std::thread::sleep(std::time::Duration::from_secs(2));
    tm.refresh().unwrap();
    std::thread::sleep(std::time::Duration::from_secs(2));

    tm.move_to(8, 8);
    tm.set_fgcolor(textmode::color::GREEN);
    tm.write_str("bar");
    tm.move_to(11, 11);
    tm.set_fgcolor(vt100::Color::Default);
    tm.write_str("baz");
    std::thread::sleep(std::time::Duration::from_secs(2));
    tm.refresh().unwrap();
    std::thread::sleep(std::time::Duration::from_secs(2));
}