diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-06 16:47:16 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-06 16:47:16 -0500 |
commit | e358c58826b1732763970848c0c6d77f12ef5e5a (patch) | |
tree | 7f81561870b340157af00d902eaceab1e43e0d4e /examples | |
parent | 0a85d9961543ef9709d0e070aa51461c8b4df34b (diff) | |
download | textmode-e358c58826b1732763970848c0c6d77f12ef5e5a.tar.gz textmode-e358c58826b1732763970848c0c6d77f12ef5e5a.zip |
basic sketch of an implementation
Diffstat (limited to 'examples')
-rw-r--r-- | examples/basic.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/basic.rs b/examples/basic.rs new file mode 100644 index 0000000..1026834 --- /dev/null +++ b/examples/basic.rs @@ -0,0 +1,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)); +} |