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

From: Veer (diggerrrrr at gmail.com)
Date: Wed Nov 26 10:28:27 EST 2008

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
>>
>


Posted on the users mailing list.