diff options
author | marc_culler <marc.culler@gmail.com> | 2023-11-19 16:11:05 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2023-11-19 16:11:05 (GMT) |
commit | f28d954bfec94579d39e5a1f71363e42066b49c4 (patch) | |
tree | 854fb433288fbac767e6d0bd22cf8b4ebec95b7b /library | |
parent | 295a4dd3fc0ace2082cfc84d80601b6efb7c56c8 (diff) | |
download | tk-f28d954bfec94579d39e5a1f71363e42066b49c4.zip tk-f28d954bfec94579d39e5a1f71363e42066b49c4.tar.gz tk-f28d954bfec94579d39e5a1f71363e42066b49c4.tar.bz2 |
Fix the MouseWheel bindings for the Listbox.
Diffstat (limited to 'library')
-rw-r--r-- | library/listbox.tcl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl index f0009bf..6ef5096 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -175,18 +175,34 @@ bind Listbox <Button-2> { bind Listbox <B2-Motion> { %W scan dragto %x %y } - +set HiresScrollMask 512 bind Listbox <MouseWheel> { - tk::MouseWheel %W y %D -40.0 + if {[expr {%s & $HiresScrollMask}]} { + tk::MouseWheel %W y %D -1.0 units + } else { + tk::MouseWheel %W y [tk::ScaleNum %D] -30.0 units + } } bind Listbox <Option-MouseWheel> { - tk::MouseWheel %W y %D -12.0 + if {[expr {%s & $HiresScrollMask}]} { + tk::MouseWheel %W y %D -0.3 units + } else { + tk::MouseWheel %W y [tk::ScaleNum %D] -10.0 units + } } bind Listbox <Shift-MouseWheel> { - tk::MouseWheel %W x %D -40.0 + if {[expr {%s & $HiresScrollMask}]} { + tk::MouseWheel %W x %D -12.0 units + } else { + tk::MouseWheel %W x [tk::ScaleNum %D] -1.2 units + } } bind Listbox <Shift-Option-MouseWheel> { - tk::MouseWheel %W x %D -12.0 + if {[expr {%s & $HiresScrollMask}]} { + tk::MouseWheel %W x %D -4.0 units + } else { + tk::MouseWheel %W x [tk::ScaleNum %D] -0.3 units + } } # ::tk::ListboxBeginSelect -- |