Re: Patch for wheel mouse support



On 5 Sep 1998, Guillaume Laurent wrote:

> 
> The following patch enables scrollbar to be moved with the mouse
> wheel (applies against gtk+ 1.1.1, should apply against 1.0.5 too) :
> 
> The only problem is that it requires the user to move the mouse over a
> scrollbar. I'm looking for an elegant way to achieve the same effect
> while on scrolled windows, suggestions welcome.

My experience using a wheel-mouse under Windows is that the focus issues
are not trivial. I suspect that the best approach may be to scroll
whatever widget has the keyboard focus, but others might just as well want
to be able to scroll whatever widget was last scrolled, or is under the
mouse.

> --- gtkrange.c  Fri Jul 10 02:41:00 1998
> +++ gtkrange.c.new      Sat Sep  5 18:56:14 1998
> @@ -773,7 +773,23 @@
>        range->x_click_point = event->x;
>        range->y_click_point = event->y;
>  
> -      if (event->window == range->trough)
> +      if(range->button == 4)
> +       {
> +         range->scroll_type = GTK_SCROLL_PAGE_BACKWARD;
> +         gtk_range_scroll (range, -1);
> +         gtk_range_add_timer (range);
> +         gtk_range_draw_step_back (range);
> +       }
> +      
> +      else if(range->button == 5)
> +       {
> +         range->scroll_type = GTK_SCROLL_PAGE_FORWARD;
> +         gtk_range_scroll (range, -1);
> +         gtk_range_add_timer (range);
> +         gtk_range_draw_step_forw (range);
> +       }
> +      
> +      else if (event->window == range->trough)
>         {
>           range->click_child = RANGE_CLASS (range)->trough;
>           
> 
> 
> -- 
> 					Guillaume.
> 					http://www.worldnet.fr/~glaurent
> 
> 
> -- 
>          To unsubscribe: mail gtk-devel-list-request@redhat.com with 
>                        "unsubscribe" as the Subject.
> 
> 

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)




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