[plt-scheme] Re: scroll-event produce wrong direction?

From: Eduardo Bellani (ebellani at gmail.com)
Date: Wed Nov 26 11:21:15 EST 2008

I confirm it on ubuntu 8.04 PLT version 4.1.1

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJLXdxTGtma8x8sd4RAoHMAJ9564yrbjaMXrn/0oSfg3jGrvcv1gCbBdhf
D9E0zNFSnU6A3As6Nok0MIg=
=UYD6
-----END PGP SIGNATURE-----

On Wed, Nov 26, 2008 at 2:15 PM, David Vanderson
<david.vanderson at gmail.com> wrote:
> I can confirm.  I used your code with #lang scheme/gui at the top.  I'm
> running 4.1.3 on Ubuntu 8.10.  Some additional tests:
>
> Single clicking on the scroll arrows or above or below the scroll handle
> produces one "Direction : vertical" (and nothing else).
>
> Single clicking on the scroll handle produces one "Direction : horizontal"
> (and nothing else).
>
> Do people not on Linux get this behavior?
>
> Thanks,
> Dave
>
> Veer wrote:
>>
>> Hello,
>> So is this a bug or it is meant to be like this? If possible can
>> anyone running linux confirm  by running the above code produces
>> same output or not , so that i either upgrade to newer version or move on.
>>
>> Thanks
>> Veer.
>>
>> My version is 4.1 , and i am on linux (ubuntu)
>>
>>
>>
>>
>> On Tue, Nov 25, 2008 at 9:39 PM, Veer <diggerrrrr at gmail.com> wrote:
>>>
>>> Sorry , i forgot to attach the output.
>>>
>>> Output:
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : vertical
>>> Direction : horizontal
>>>
>>>
>>> On Tue, Nov 25, 2008 at 9:35 PM, Veer <diggerrrrr at gmail.com> wrote:
>>>>
>>>> Hello ,
>>>>
>>>> The code below captures the on-scroll event and outputs the direction.
>>>> So when i run the program and continuously drag the vertical scrollbar
>>>> the output produces "vertical" which is correct , but once i stop
>>>> dragging
>>>> the bar the last output is "horizontal" . Since i have enabled only
>>>> vertical scrollbar , any reason for this?
>>>>
>>>> Code :
>>>>
>>>> (define a-frame
>>>>  (new frame%
>>>>      [label "Scrollbars"]
>>>>      [width 300]
>>>>      [height 300]))
>>>>
>>>> (define scroll-canvas%
>>>>  (class canvas%
>>>>
>>>>   (super-new)
>>>>   (inherit get-dc)
>>>>
>>>>   (define (char-height)
>>>>     (send (get-dc) get-char-height))
>>>>
>>>>   (define (page-unit)
>>>>     (inexact->exact
>>>>      (floor (/ (send this get-height) (char-height)))))
>>>>
>>>>   (define/override (on-size w h)
>>>>     (send this set-scroll-page 'vertical (page-unit)))
>>>>
>>>>   (define/override (on-scroll event)
>>>>     (printf "Direction : ~a\n" (send event get-direction)))
>>>>
>>>>   (send this init-manual-scrollbars #f 100 1 (page-unit) 0 0)
>>>>
>>>>   ))
>>>>
>>>> (define scroll (new scroll-canvas% [parent a-frame] [style '(vscroll)]))
>>>> (send a-frame show #t)
>>>>
>>>> Thanks
>>>> Veer
>>>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Eduardo Bellani

www.cnxs.com.br

"What is hateful to you, do not to your fellow men. That is the entire
Law; all the rest is commentary." The Talmud


Posted on the users mailing list.