1 ;; Wish visualization module
15 (define (make-wish w h)
16 (let-values (((in out id) (process (conc "wish -geometry " w "x" h))))
17 (with-output-to-port out
19 (print "canvas .c -width " w " -height " h " -bg black")
21 (print "image create photo core -width " w " -height " h " -palette 256/256/256")
22 (print ".c create image 0 0 -anchor nw -image core")))
25 (define (wish-in wish) (car wish))
26 (define (wish-out wish) (cdr wish))
28 (define (wish% wish . args)
29 (with-output-to-port (wish-out wish)
33 (define (destroy-wish wish)
34 (wish% wish "destroy .")
35 (close-input-port (wish-in wish))
36 (close-output-port (wish-out wish)))
38 (define (set-wish-pixel wish x y col)
39 (wish% wish "core put " col " -to " x " " y)))
44 ;; (let ((w (make-wish 640 480)))
45 ;; (set-wish-pixel w 10 10 "red")