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-08 12:25:25 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-08 12:25:25 -0700
commit9fae66572d2fd3ddce43348a5c480aaa64791635 (patch)
tree5a2163c71741f427baa9d242a83c79444e824ae1 /071print.mu
parentb1ce29ddee9d95d7efa668c26de07b0b3ab48dea (diff)
downloadmu-9fae66572d2fd3ddce43348a5c480aaa64791635.tar.gz
1545 - sketching out a simple editor widget
Diffstat (limited to '071print.mu')
-rw-r--r--071print.mu28
1 files changed, 28 insertions, 0 deletions
diff --git a/071print.mu b/071print.mu
index db7c97d1..6eb72853 100644
--- a/071print.mu
+++ b/071print.mu
@@ -416,6 +416,34 @@ recipe cursor-to-next-line [
   reply x:address:screen/same-as-ingredient:0
 ]
 
+recipe screen-width [
+  default-space:address:array:location <- new location:type, 30:literal
+  x:address:screen <- next-ingredient
+  # if x exists, move cursor in fake screen
+  {
+    break-unless x:address:screen
+    width:number <- get x:address:screen/deref, num-columns:offset
+    reply width:number
+  }
+  # otherwise, real screen
+  width:number <- display-width
+  reply width:number
+]
+
+recipe screen-height [
+  default-space:address:array:location <- new location:type, 30:literal
+  x:address:screen <- next-ingredient
+  # if x exists, move cursor in fake screen
+  {
+    break-unless x:address:screen
+    height:number <- get x:address:screen/deref, num-rows:offset
+    reply height:number
+  }
+  # otherwise, real screen
+  height:number <- display-height
+  reply height:number
+]
+
 recipe print-string [
   default-space:address:array:location <- new location:type, 30:literal
   x:address:screen <- next-ingredient