From e358c58826b1732763970848c0c6d77f12ef5e5a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 6 Mar 2021 16:47:16 -0500 Subject: basic sketch of an implementation --- examples/basic.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/basic.rs (limited to 'examples') 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)); +} -- cgit v1.2.3-54-g00ecf