summaryrefslogtreecommitdiffstats
path: root/library/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-11-13 10:01:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-11-13 10:01:48 (GMT)
commitc010d97236f7ec6d00a07a74c31c571cc4b01a58 (patch)
tree2d90c4232c739e4b9dcfeeb0f3f98171f17d4404 /library/ttk
parent8e5655a41ed56f88c8dc4635ba8f50a5aae6c2ba (diff)
downloadtk-c010d97236f7ec6d00a07a74c31c571cc4b01a58.zip
tk-c010d97236f7ec6d00a07a74c31c571cc4b01a58.tar.gz
tk-c010d97236f7ec6d00a07a74c31c571cc4b01a58.tar.bz2
Fix [c0485ba8d]: Bug in the ttk::spinbox::MouseWheel proc in Tk 8.7a4
Diffstat (limited to 'library/ttk')
-rw-r--r--library/ttk/spinbox.tcl11
1 files changed, 4 insertions, 7 deletions
diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl
index f580a21..7b5d416 100644
--- a/library/ttk/spinbox.tcl
+++ b/library/ttk/spinbox.tcl
@@ -79,16 +79,13 @@ proc ttk::spinbox::Release {w} {
}
## MouseWheel --
-# Mousewheel callback. Turn these into <<Increment>> (-1, up)
-# or <<Decrement> (+1, down) events.
+# Mousewheel callback.
#
proc ttk::spinbox::MouseWheel {w dir {factor 1}} {
if {[$w instate disabled]} { return }
- if {($dir < 0) ^ ($factor < 0)} {
- event generate $w <<Increment>>
- } elseif {$dir > 0} {
- event generate $w <<Decrement>>
- }
+ set d [expr {-($dir/$factor)}]
+ set d [expr {int($d > 0 ? ceil($d) : floor($d))}]
+ ttk::spinbox::Spin $w $d
}
## SelectAll --