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

From: David Vanderson (david.vanderson at gmail.com)
Date: Wed Nov 26 11:15:14 EST 2008

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
> 


Posted on the users mailing list.