diff options
author | fvogel <fvogelnew1@free.fr> | 2018-03-25 16:05:26 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-03-25 16:05:26 (GMT) |
commit | cc843590bf0722f7ce2c48e7ca3673ead6b4c522 (patch) | |
tree | 79fd4e4d6200e5f2c238dd35f40cbd84f6722ed8 /library | |
parent | 737d44808eb279213954f4b5d4417f9bea3bd6a6 (diff) | |
download | tk-cc843590bf0722f7ce2c48e7ca3673ead6b4c522.zip tk-cc843590bf0722f7ce2c48e7ca3673ead6b4c522.tar.gz tk-cc843590bf0722f7ce2c48e7ca3673ead6b4c522.tar.bz2 |
Better solution to [75d38f8608], that fixes the problem for all widgets, not only listbox. Thanks to oehhar for some of the ideas in that patch, and to dnikolajevich for providing this implementation.
Diffstat (limited to 'library')
-rw-r--r-- | library/listbox.tcl | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl index 96d3f11..4c93104 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -201,18 +201,10 @@ if {[tk windowingsystem] eq "aqua"} { } } else { bind Listbox <MouseWheel> { - incr tk::Priv(wheel_acc_v_%W) %D - if {abs($tk::Priv(wheel_acc_v_%W)) >= 120} { - %W yview scroll [expr {- ($tk::Priv(wheel_acc_v_%W) / 120) * 4}] units - set tk::Priv(wheel_acc_v_%W) 0 - } + %W yview scroll [expr {- (%D / 120) * 4}] units } bind Listbox <Shift-MouseWheel> { - incr tk::Priv(wheel_acc_h_%W) %D - if {abs($tk::Priv(wheel_acc_h_%W)) >= 120} { - %W xview scroll [expr {- ($tk::Priv(wheel_acc_h_%W) / 120) * 4}] units - set tk::Priv(wheel_acc_h_%W) 0 - } + %W xview scroll [expr {- (%D / 120) * 4}] units } } |