add support for 'lib paths in define-runtime-path, and change world.ss to use it

svn: r6150
This commit is contained in:
Matthew Flatt 2007-05-05 00:17:06 +00:00
parent ba66079155
commit e85a15df98
3 changed files with 16 additions and 2 deletions

View File

@ -674,6 +674,12 @@
(and (file-exists? p)
p)))
(get-lib-search-dirs)))]
[(and (list? p)
(eq? 'lib (car p)))
(build-path (if (null? (cddr p))
(collection-path "mzlib")
(apply collection-path (cddr p)))
(cadr p))]
[else p])])
(and p
(path->bytes

View File

@ -578,8 +578,8 @@ Matthew
;; 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-runtime-path s:pth '(lib "break.png" "icons"))
(define-runtime-path i:pth '(lib "file.gif" "icons"))
(define (add-stop-and-image-buttons frame the-play-back-custodian)
(define p (new horizontal-pane% [parent frame][alignment '(center center)]))
(define S ((bitmap-label-maker (string-constant break-button-label) s:pth) '_))

View File

@ -67,6 +67,14 @@
p)))
(get-lib-search-dirs))
(cadr p)))]
[(and (list? p)
((length p) . > . 1)
(eq? 'lib (car p))
(andmap string? (cdr p)))
(let ([dir (if (null? (cddr p))
(collection-path "mzlib")
(apply collection-path (cddr p)))])
(build-path dir (cadr p)))]
[else (error 'runtime-path "unknown form: ~e" p)])))
paths)))