[plt-scheme] Problem with teachpaks
I have problems using gui.ss and draw.ss at the same time.
As a project my students have made a snake game using
only draw.ss. For extras I suggested they made a gui with
a highscore and a new game button. Alas, there are something
wrong.
The following illustrates the problem. I am not able to click
the button if the loop is on. Its on winxp version 203
(but you probably guessed that since I use get-key-event).
Is there a work around?
; advanced student language, draw.ss and gui.ss
(define (call-back event)
(begin
(display "foo")
true))
(define (loop)
(begin
(get-key-event)
(sleep-for-a-while 1)
(loop)))
(start 100 100)
(create-window (list (list (make-button "foo" call-back))))
(loop)
Yours,
--
Jens Axel Søgaard