Re: [gtk-list] Re: Mouse wheel support for gtk+

On Tue, 26 Jan 1999 08:49:12 Owen Taylor wrote:
> But I must admit that when I was home over the break, and
> using a scrollwheel mouse, I noticed that it is one of 
> those things that, when you have it, is sort of hard
> to leave alone and not twiddle. And it felt strange
> to have it do nothing under X. So I guess it would
> be a selling point for GTK+ to have it work.

Silly as it may seem, it sure becomes a useful little toy.  :-)

> The following is a quick patch to make scrollwheels work
> for range controls and for almost any widget inside of
> scrolled window.
> I'm not sure that the use of adj->step_increment is right -
> it's probably too small. But, adj->page_size seems to
> big to me. (Both of these feelings are without actually 
> having a suitable mouse to test it with.) Maybe it
> should be page_size/3 or sqrt (step_size * page_size).

I personally think that it should be at least page_size/2, but
definatly not the full page.

I tried out the patch, and it works well.  However, using the
wheel to scroll down will scroll past the end of the page by
about page_size.  When scrolling up, there are no problems.

>From my quick parse of the gtk_adjustment source I think that
there may be a bug in the way that gtkscrolledwindow is setting
either the upper or lower value in the gtk_adjustment, it's just
been hidden up to now.  Hope this helps.  If I knew more about
the workings of the scrolled windows, I'd supply a patch, but
I'm still learning.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]