Hi All,

I have a little problem with the attached program.
Maybe, I am not 100% sure, the slider% calls the call-back
more than once (maybe 4 times?) after the release of the mouse.
The behaviour puzzles me.

Is it the intended behaviour? If so, is there a better way
to use the slider, than the one in the attached program?

I found the following program by António Leitão from June 2011
on the mailing list, which shows this oddity.

(require racket/gui)
(define frame (new frame% [label "Example"]))
(new slider% [parent frame]
             [label "Test"]
             [min-value 0]
             [max-value 10]
             [callback (lambda (slider event)
                         (display
                          (format "~a@~a: ~a~%"
                                  (send event get-event-type)
                                  (send event get-time-stamp)
                                  (send slider get-value))))])

(send frame show #t)

On my computer,  if I run the program, and then move the
slider to 5 and release the mouse, I get this output:

slider@-273484745: 0
slider@-273484095: 1
slider@-273482097: 5
slider@-273482096: 5
slider@-273482096: 5
slider@-273482096: 5
slider@-273482096: 5


--
Jens Axel Søgaard

Attachment: graphical-michaelis-menten.rkt
Description: Binary data

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to