diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-06-23 23:03:56 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-06-23 23:03:56 -0700 |
commit | 54edd3d25e990cdf6ead2f0cdf685bc23de85edf (patch) | |
tree | 5479bfaf361a485570b2ebbe22064fefe9b55a89 /sandbox | |
parent | b2eff9f97e02fe6f5f55133002c16116aac13ed4 (diff) | |
download | mu-54edd3d25e990cdf6ead2f0cdf685bc23de85edf.tar.gz |
3943
Undo commit 3938 and almost everything after. Let's do this right.
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/005-sandbox.mu | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index 3d06b7d9..cc7892d6 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -12,7 +12,7 @@ def! main [ open-console clear-screen 0/screen # non-scrolling app env:&:environment <- new-programming-environment 0/filesystem, 0/screen - env <- restore-sandboxes env + env <- restore-sandboxes env, 0/filesystem render-all 0/screen, env, render event-loop 0/screen, 0/console, env, 0/filesystem ] @@ -260,13 +260,13 @@ def render-sandboxes screen:&:screen, sandbox:&:sandbox, left:num, right:num, ro env:&:environment, _/optional <- next-ingredient return-unless sandbox screen-height:num <- screen-height screen + at-bottom?:bool <- greater-or-equal row, screen-height + return-if at-bottom? hidden?:bool <- lesser-than idx, render-from { break-if hidden? # render sandbox menu row <- add row, 1 - at-bottom?:bool <- greater-or-equal row, screen-height - return-if at-bottom? screen <- move-cursor screen, row, left screen <- render-sandbox-menu screen, idx, left, right # save menu row so we can detect clicks to it later @@ -326,36 +326,6 @@ def render-sandbox-menu screen:&:screen, sandbox-index:num, left:num, right:num clear-line-until screen, right, 52/background-red ] -scenario skip-rendering-sandbox-menu-past-bottom-row [ - trace-until 100/app # trace too long - assume-screen 50/width, 7/height - # recipes.mu is empty - assume-resources [ - ] - # create two sandboxes such that the top one just barely fills the screen - env:&:environment <- new-programming-environment resources, screen, [] - render-all screen, env, render - assume-console [ - left-click 1, 75 - type [add 1, 1] - press F4 - type [add 2, 2] - press F4 - ] - run [ - event-loop screen, console, env, resources - ] - screen-should-contain [ - . run (F4) . - . . - .──────────────────────────────────────────────────. - .0 edit copy delete . - .add 2, 2 . - .4 . - .──────────────────────────────────────────────────. - ] -] - # divide up the menu bar for a sandbox into 3 segments, for edit/copy/delete buttons # delete-button-right == right # all left/right pairs are inclusive |