Patch for wheel mouse support




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.

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



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