aboutsummaryrefslogtreecommitdiffstats
path: root/examples/basic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basic.rs')
-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));
+}