[racket] Bug or feature?

From: Marijn (hkBst at gentoo.org)
Date: Mon Jun 6 03:37:15 EDT 2011

Hash: SHA1

Ho Antonio,

you didn't specify a version or give actual output of your program.

On my racket (git version of perhaps one or two weeks old) I don't see
what you describe. If I run the program, an (annoyingly small) window is
created and if I click and release to increase the slider from 0 to 1
the interactions window shows:

(object:slider% ...)
slider at 1307345547311: 1


On 06/03/11 18:19, Antonio Menezes Leitao wrote:
> Hi,
> I noticed a strange behavior in Racket slider% widget.
> It seems that when I stop dragging the slider it makes two additional
> unnecessary callback calls.  This behavior is visible in the following
> example:
> (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)
> Even a single click in the slider calls the callback twice
> when the mouse button is released.
> I also noticed that this behavior happens both with Racket in
> Windows 7 and with the older DrScheme in Windows XP.
> Is this a bug or a feature?
> Thanks,
> António Leitão
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users

Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


Posted on the users mailing list.