summaryrefslogtreecommitdiffstats
path: root/library
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
parent8fd51a3af56f939141292c381db8875972ffa188 (diff)
downloadtk-ab77298ee1fb2dd99c446e8fd7b1cad4a27a751e.zip
tk-ab77298ee1fb2dd99c446e8fd7b1cad4a27a751e.tar.gz
tk-ab77298ee1fb2dd99c446e8fd7b1cad4a27a751e.tar.bz2
Fix test-failure in scrollbar test
Diffstat (limited to 'library')
-rw-r--r--library/scrlbar.tcl14
-rw-r--r--library/ttk/notebook.tcl9
2 files changed, 14 insertions, 9 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
+ }
}
}
diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl
index d8ed23b..3d277a4 100644
--- a/library/ttk/notebook.tcl
+++ b/library/ttk/notebook.tcl
@@ -98,10 +98,13 @@ proc ttk::notebook::CondCycleTab {w axis dir {factor 1.0}} {
variable ::tk::Priv
incr Priv(${axis}Events)
- if {($Priv(xEvents) + $Priv(yEvents) > 10) &&
- ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) ||
- $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} {
+ if {[info exists Priv(xEvents)] && [info exists Priv(yEvents)]} {
+
+ if {($Priv(xEvents) + $Priv(yEvents) > 10) &&
+ ($axis eq "x" && $Priv(xEvents) < $Priv(yEvents) ||
+ $axis eq "y" && $Priv(yEvents) < $Priv(xEvents))} {
return
+ }
}
CycleTab $w $dir $factor