use .rkt suffix => avoid a bug when trying to show the file

This commit is contained in:
Eli Barzilay 2010-08-28 23:46:31 -04:00
parent 8328605c1a
commit 3b609eef10

View File

@ -8,9 +8,13 @@
slideshow/code slideshow/code
mred mred
scheme/class scheme/class
racket/path
racket/runtime-path
(only-in mzlib/etc begin-with-definitions (only-in mzlib/etc begin-with-definitions
this-expression-source-directory)) this-expression-source-directory))
(define-runtime-path tutorial-show "tutorial-show.rkt")
(provide do-initial-slides) (provide do-initial-slides)
(define (do-initial-slides) (define (do-initial-slides)
@ -146,7 +150,7 @@
"be viewed while reading the program source") "be viewed while reading the program source")
(blank) (blank)
(para #:width client-w "The source is") (para #:width client-w "The source is")
(let ([s (path->string (build-path (this-expression-source-directory) "tutorial-show.ss"))]) (let ([s (path->string tutorial-show)])
(clickback (clickback
(scale/improve-new-text (scale/improve-new-text
(let ([p (tt s)]) (let ([p (tt s)])
@ -156,14 +160,11 @@
"blue")) "blue"))
(min 1 (/ (* 0.8 client-w ) (pict-width (tt s))))) (min 1 (/ (* 0.8 client-w ) (pict-width (tt s)))))
(lambda () (lambda ()
(let* ([f (new frame% (let* ([f (new frame% [label (path-element->string
[label "tutorial-show.ss"] (file-name-from-path tutorial-show))]
[width 600] [width 600] [height 400])]
[height 400])]
[e (new text%)] [e (new text%)]
[c (new editor-canvas% [c (new editor-canvas% [parent f] [editor e])])
[parent f]
[editor e])])
(send e load-file s) (send e load-file s)
(send e change-style (send e change-style
(make-object style-delta% 'change-family 'modern) (make-object style-delta% 'change-family 'modern)