[plt-scheme] Odd slider% behaviour?

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

On Wed, Sep 02, 2009 at 11:37:33AM +1000, Andrew Reilly wrote:
> Sorry for the followup-to-self, again.

OK, a seemingly tiny variation on the previous version "works".
Well, the actual output of the position sequence doesn't show up
on the IDE console until the mouse lets go of the slider, but
this is definite improvement:

#lang scheme/gui

(let ((t (thread (lambda ()
                   (let loop ()
                     (printf "~a~%" (thread-receive))
                     (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)
          (thread-send t (send s get-value)))))
  (send f show #t)
  (yield 'wait)
  (kill-thread t))

So, I guess that my question boils down to: what is different,
here?  The documentation seems to suggest that the thread
message box that I'm using now is just one of the async-channels
that I had in the previous attempt.

Hmm.  When run from the console with mred, the output still
doesn't appear until the mouse button is released.  That might
not suit my purposes yet, but we'll see...

Cheers,

-- 
Andrew


Posted on the users mailing list.