summaryrefslogtreecommitdiffstats
path: root/library/scrlbar.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-12-01 09:23:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-12-01 09:23:40 (GMT)
commitab77298ee1fb2dd99c446e8fd7b1cad4a27a751e (patch)
treecf0021eb4c20e7dec113dfcd25f51400223b09d8 /library/scrlbar.tcl
parent8fd51a3af56f939141292c381db8875972ffa188 (diff)
downloadtk-ab77298ee1fb2dd99c446e8fd7b1cad4a27a751e.zip
tk-ab77298ee1fb2dd99c446e8fd7b1cad4a27a751e.tar.gz
tk-ab77298ee1fb2dd99c446e8fd7b1cad4a27a751e.tar.bz2
Fix test-failure in scrollbar test
Diffstat (limited to 'library/scrlbar.tcl')
-rw-r--r--library/scrlbar.tcl14
1 files changed, 8 insertions, 6 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 35ff251..fa3af8e 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -327,12 +327,14 @@ proc ::tk::ScrollByUnits {w orient amount {factor 1.0}} {
# events, and ignore the non-dominant ones
variable ::tk::Priv
- set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}]
- incr Priv(${axis}Events)
- if {($Priv(xEvents) + $Priv(yEvents) > 10) &&
- ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) ||
- $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} {
- return
+ if {[info exists Priv(xEvents)] && [info exists Priv(yEvents)]} {
+ set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}]
+ incr Priv(${axis}Events)
+ if {($Priv(xEvents) + $Priv(yEvents) > 10) &&
+ ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) ||
+ $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} {
+ return
+ }
}
}