aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-06 16:47:16 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-06 16:47:16 -0500
commite358c58826b1732763970848c0c6d77f12ef5e5a (patch)
tree7f81561870b340157af00d902eaceab1e43e0d4e /examples
parent0a85d9961543ef9709d0e070aa51461c8b4df34b (diff)
downloadtextmode-e358c58826b1732763970848c0c6d77f12ef5e5a.tar.gz
textmode-e358c58826b1732763970848c0c6d77f12ef5e5a.zip
basic sketch of an implementation
Diffstat (limited to 'examples')
-rw-r--r--examples/basic.rs19
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));
+}