[plt-scheme] Odd slider% behaviour?

From: Andrew Reilly (andrew-scheme at areilly.bpc-users.org)
Date: Tue Sep 1 21:37:33 EDT 2009

Sorry for the followup-to-self.  Just thought that I'd show
another experiment that I've tried, that also didn't "work".
This one uses an async-channel and a thread to try to decouple
the slider and the "use the position" process, but the behaviour
is the same "stuck slider" as before:

#lang scheme/gui
(require scheme/async-channel)

(let ((c (make-async-channel)))
  (let ((t (thread (lambda ()
                     (let loop ()
                       (printf "~a~%" (async-channel-get c))
                       (flush-output)
                       (loop)))))
        (f (new frame% (label "SLIDER TEST"))))
    (new slider%
         (parent f)
         (label "foo")
         (min-value 0)
         (max-value 400)
         (init-value 200)
         (style '(horizontal horizontal-label plain))
         (min-height 50)
         (min-width 400)
         (callback
          (lambda (s e)
            (async-channel-put c (send s get-value)))))
    (send f show #t)
    (yield 'wait)
    (kill-thread t)))

Cheers,

-- 
Andrew


Posted on the users mailing list.