commander-s/scheme/std-viewer.scm

29 lines
582 B
Scheme
Raw Normal View History

(define (make-standard-viewer)
(let ((x 1)
(y 1)
(text "")
(value #f))
(lambda (message)
(cond
((eq? message 'init)
(lambda (self new-value buffer)
(set! value new-value)
(set! text
(layout-result-standard
(exp->string value)
(result-buffer-num-cols buffer)))
self))
((eq? message 'paint)
(lambda (self win buffer have-focus?)
;; #### get rid of this cruft
((make-simple-result-buffer-printer y x text '() '())
win buffer have-focus?)))
((eq? message 'key-press)
(lambda (self . ignore)
self))))))