changeset 4968:713426631adf

hgk: enable mouse wheel on MouseWheel events. At this point, mouse wheel still does not work under Windows.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 22 Jul 2007 16:21:49 +0200
parents cf67b5f3743d
children b43db44cd047
files contrib/hgk
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgk	Sun Jul 22 09:45:18 2007 +0200
+++ b/contrib/hgk	Sun Jul 22 16:21:49 2007 +0200
@@ -299,6 +299,11 @@
     }
 }
 
+proc allcansmousewheel {delta} {
+    set delta [expr -5*(int($delta)/abs($delta))]
+    allcanvs yview scroll $delta units
+}
+
 proc error_popup msg {
     set w .error
     toplevel $w
@@ -470,6 +475,7 @@
 
     bindall <1> {selcanvline %W %x %y}
     #bindall <B1-Motion> {selcanvline %W %x %y}
+    bindall <MouseWheel> "allcansmousewheel %D"
     bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
     bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
     bindall <2> "allcanvs scan mark 0 %y"