diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-18 20:42:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-18 20:42:57 (GMT) |
commit | 452f3387dfdfe45cb1fc59b28657e5111a2778d8 (patch) | |
tree | 2963a8cef29c683ccc7d3ef33fc5ea2880230d88 /library/iconlist.tcl | |
parent | c0c401e9d4e7565e3d5b2adda77fe939fd766ee6 (diff) | |
parent | ef0195454b1d958bcad88274c0246d0ac81b781c (diff) | |
download | tk-452f3387dfdfe45cb1fc59b28657e5111a2778d8.zip tk-452f3387dfdfe45cb1fc59b28657e5111a2778d8.tar.gz tk-452f3387dfdfe45cb1fc59b28657e5111a2778d8.tar.bz2 |
Merge 8.6. Also add <6> and <7> bindings for X11, where appropriate
Diffstat (limited to 'library/iconlist.tcl')
-rw-r--r-- | library/iconlist.tcl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/library/iconlist.tcl b/library/iconlist.tcl index 62b0b2d..30352a1 100644 --- a/library/iconlist.tcl +++ b/library/iconlist.tcl @@ -446,6 +446,19 @@ package require Tk 8.6 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 * (%W)}]}] + bind $canvas <Option-Shift-MouseWheel> [namespace code {my MouseWheel [expr {400 * (%W)}]}] + } else { + bind $canvas <Shift-MouseWheel> [namespace code {my MouseWheel %W}] + } + if {[tk windowingsystem] eq "x11"} { + bind $canvas <Shift-4> [namespace code {my MouseWheel 120}] + bind $canvas <Shift-5> [namespace code {my MouseWheel -120}] + bind $canvas <6> [namespace code {my MouseWheel 120}] + bind $canvas <7> [namespace code {my MouseWheel -120}] + } + bind $canvas <<PrevLine>> [namespace code {my UpDown -1}] bind $canvas <<NextLine>> [namespace code {my UpDown 1}] bind $canvas <<PrevChar>> [namespace code {my LeftRight -1}] @@ -492,6 +505,16 @@ package require Tk 8.6 # ---------------------------------------------------------------------- # Event handlers + method MouseWheel {amount} { + if {$noScroll || $::tk_strictMotif} { + return + } + if {$amount > 0} { + $canvas xview scroll [expr {(-119-$amount) / 120}] units + } else { + $canvas xview scroll [expr {-($amount / 120)}] units + } + } method Btn1 {x y} { focus $canvas set i [$w index @$x,$y] |