From dc89309339a2331d83e5b0b9db3cfe6c811be73b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 27 Nov 2016 13:03:05 -0800 Subject: 3697 Decouple programming environment initialization from rendering. This helps make clear that we only need the width from screen during initialization. --- html/edit/004-programming-environment.mu.html | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'html') diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index ed1bd4ad..8b6e4c62 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -56,23 +56,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color sandbox-in-focus?:bool # false => cursor in recipes; true => cursor in current-sandbox ] -def new-programming-environment screen:&:screen, initial-recipe-contents:text, initial-sandbox-contents:text -> result:&:environment, screen:&:screen [ +def new-programming-environment screen:&:screen, initial-recipe-contents:text, initial-sandbox-contents:text -> result:&:environment [ local-scope load-ingredients width:num <- screen-width screen - height:num <- screen-height screen - # top menu result <- new environment:type - draw-horizontal screen, 0, 0/left, width, 32/space, 0/black, 238/grey - button-start:num <- subtract width, 20 - button-on-screen?:bool <- greater-or-equal button-start, 0 - assert button-on-screen?, [screen too narrow for menu] - screen <- move-cursor screen, 0/row, button-start - print screen, [ run (F4) ], 255/white, 161/reddish - # dotted line down the middle - divider:num, _ <- divide-with-remainder width, 2 - draw-vertical screen, divider, 1/top, height, 9482/vertical-dotted # recipe editor on the left + divider:num, _ <- divide-with-remainder width, 2 recipes:&:editor <- new-editor initial-recipe-contents, 0/left, divider/right # sandbox editor on the right sandbox-left:num <- add divider, 1 @@ -326,7 +316,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color return row, column, screen/same-as-ingredient:0, editor/same-as-ingredient:1 ] - scenario point-at-multiple-editors [ local-scope trace-until 100/app # trace too long -- cgit 1.4.1-2-gfad0