From 4744c559b08843e3dbd2839fc6d8b77e2c3ecfc1 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Fri, 4 May 2007 22:16:26 +0000 Subject: [PATCH] htdp, testing svn: r6147 --- collects/htdp/Test/world.ss | 2 +- collects/htdp/world.ss | 20 +++++++++----------- collects/teachpack/htdp/testing.ss | 1 - 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/collects/htdp/Test/world.ss b/collects/htdp/Test/world.ss index 290992e602..3789a1e951 100644 --- a/collects/htdp/Test/world.ss +++ b/collects/htdp/Test/world.ss @@ -26,7 +26,7 @@ ;; run world run -(big-bang 100 100 .1 world0) +(big-bang 100 100 .1 world0 true) ;; get ready to create images (on-redraw world->image) (on-tick-event world->next) diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss index 0293b802b0..993f2580d4 100644 --- a/collects/htdp/world.ss +++ b/collects/htdp/world.ss @@ -23,6 +23,7 @@ ones.) Matthew |# +;; Fri May 4 18:05:33 EDT 2007: define-run-time-path ;; Thu May 3 22:06:16 EDT 2007: scene # image; pasteboard% for text% ;; Sat Apr 28 13:31:02 EDT 2007: fixed the image and animated-gif thing, using Matthew's lib ;; Fri Dec 22 11:51:53 EST 2006: cleaned up the callback code with macro @@ -38,9 +39,6 @@ Matthew (module world mzscheme (require (lib "class.ss") (lib "etc.ss") - (lib "list.ss") - (lib "process.ss") - (lib "port.ss") (lib "mred.ss" "mred") (lib "error.ss" "htdp") (lib "image.ss" "htdp") @@ -49,6 +47,7 @@ Matthew (lib "prim.ss" "lang")) (require (lib "gif.ss" "mrlib")) + (require (lib "runtime-path.ss")) (require (lib "bitmap-label.ss" "mrlib") (lib "string-constant.ss" "string-constants")) @@ -578,22 +577,21 @@ Matthew ;; Frame [Box (union false Thread)] -> Void ;; adds the stop animation and image creation button, ;; whose callbacks runs as a thread in the custodian + (define IMAGES "Images") + (define-runtime-path s:pth (build-path (collection-path "icons") "break.png")) + (define-runtime-path i:pth (build-path (collection-path "icons") "file.gif")) (define (add-stop-and-image-buttons frame the-play-back-custodian) (define p (new horizontal-pane% [parent frame][alignment '(center center)])) - (define l-stop ((bitmap-label-maker - (string-constant break-button-label) - (build-path (collection-path "icons") "break.png")) '___)) - (define l-imgs ((bitmap-label-maker - "Images" - (build-path (collection-path "icons") "file.gif")) '___)) + (define S ((bitmap-label-maker (string-constant break-button-label) s:pth) '_)) + (define I ((bitmap-label-maker IMAGES i:pth) '_)) (define stop-button - (new button% [parent p] [label l-stop] [style '(border)] + (new button% [parent p] [label S] [style '(border)] [callback (lambda (this-button e) (callback-stop!) (send this-button enable #f) (send image-button enable #t))])) (define image-button - (new button% [parent p] [enabled #f] [label l-imgs] [style '(border)] + (new button% [parent p] [enabled #f] [label I] [style '(border)] [callback (lambda (b e) (parameterize ([current-custodian the-play-back-custodian]) (define th (thread play-back)) diff --git a/collects/teachpack/htdp/testing.ss b/collects/teachpack/htdp/testing.ss index aee6a8a0c2..fc8b1452d5 100644 --- a/collects/teachpack/htdp/testing.ss +++ b/collects/teachpack/htdp/testing.ss @@ -1,4 +1,3 @@ -#cs (module testing mzscheme (provide (all-from (lib "testing.ss" "htdp"))) (require (lib "testing.ss" "htdp")))