summaryrefslogtreecommitdiffstats
path: root/library/iconlist.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/iconlist.tcl')
-rw-r--r--library/iconlist.tcl29
1 files changed, 5 insertions, 24 deletions
diff --git a/library/iconlist.tcl b/library/iconlist.tcl
index a19dbeb..c052efb 100644
--- a/library/iconlist.tcl
+++ b/library/iconlist.tcl
@@ -446,18 +446,9 @@ package require Tk
bind $canvas <Control-B1-Motion> {;}
bind $canvas <Shift-B1-Motion> [namespace code {my ShiftMotion1 %x %y}]
- if {[tk windowingsystem] eq "aqua"} {
- bind $canvas <Shift-MouseWheel> [namespace code {my MouseWheel [expr {40 * (%D)}]}]
- bind $canvas <Option-Shift-MouseWheel> [namespace code {my MouseWheel [expr {400 * (%D)}]}]
- } else {
- bind $canvas <Shift-MouseWheel> [namespace code {my MouseWheel %D}]
- }
- if {[tk windowingsystem] eq "x11"} {
- bind $canvas <Shift-Button-4> [namespace code {my MouseWheel 120}]
- bind $canvas <Shift-Button-5> [namespace code {my MouseWheel -120}]
- bind $canvas <Button-6> [namespace code {my MouseWheel 120}]
- bind $canvas <Button-7> [namespace code {my MouseWheel -120}]
- }
+ bind $canvas <Shift-MouseWheel> [namespace code {my MouseWheel %D}]
+ bind $canvas <Option-Shift-MouseWheel> [namespace code {my MouseWheel %D -12}]
+
bind $canvas <<PrevLine>> [namespace code {my UpDown -1}]
bind $canvas <<NextLine>> [namespace code {my UpDown 1}]
@@ -505,21 +496,11 @@ package require Tk
# ----------------------------------------------------------------------
# Event handlers
- method MouseWheel {amount} {
+ method MouseWheel {amount {factor -120.0}} {
if {$noScroll || $::tk_strictMotif} {
return
}
- # We must make sure that positive and negative movements are rounded
- # equally to integers, avoiding the problem that
- # (int)1/120 = 0,
- # but
- # (int)-1/120 = -1
- # The following code ensure equal +/- behaviour.
- if {$amount > 0} {
- $canvas xview scroll [expr {(-119-$amount) / 120}] units
- } else {
- $canvas xview scroll [expr {-($amount / 120)}] units
- }
+ $canvas xview scroll [expr {$amount/$factor}] units
}
method Btn1 {x y} {
focus $canvas