about summary refs log tree commit diff stats
path: root/071print.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-06-25 09:25:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-25 09:25:49 -0700
commit48bb86278826a08e2550f2c49e695167fb137957 (patch)
tree7428588a5270d1c867706ec722d2103e4d4401bb /071print.mu
parentec3aa9e03f1c97e5dd904a448f3b73386a6a4e67 (diff)
downloadmu-48bb86278826a08e2550f2c49e695167fb137957.tar.gz
1655 - first attempt at smooth refresh: hide-cursor
But it doesn't work, because moving the cursor inside 'render' also
starts displaying it again.
Diffstat (limited to '071print.mu')
-rw-r--r--071print.mu26
1 files changed, 26 insertions, 0 deletions
diff --git a/071print.mu b/071print.mu
index 9fcfb018..a5cb191b 100644
--- a/071print.mu
+++ b/071print.mu
@@ -533,6 +533,32 @@ recipe screen-height [
   reply height:number
 ]
 
+recipe hide-cursor [
+  default-space:address:array:location <- new location:type, 30:literal
+  x:address:screen <- next-ingredient
+  # if x exists (not real display), do nothing
+  {
+    break-unless x:address:screen
+    reply x:address:screen
+  }
+  # otherwise, real screen
+  hide-cursor-on-display
+  reply x:address:screen
+]
+
+recipe show-cursor [
+  default-space:address:array:location <- new location:type, 30:literal
+  x:address:screen <- next-ingredient
+  # if x exists (not real display), do nothing
+  {
+    break-unless x:address:screen
+    reply x:address:screen
+  }
+  # otherwise, real screen
+  show-cursor-on-display
+  reply x:address:screen
+]
+
 recipe print-string [
   default-space:address:array:location <- new location:type, 30:literal
   x:address:screen <- next-ingredient