summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-20 15:36:32 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-20 15:36:32 (GMT)
commitb16455219c1d8d926e0d2c7c21bab77f5f3cdeca (patch)
tree636ba32f57be66facc07eedfea0b5bbaedee21c6 /tests
parent67e988d91e334012540dd809938f412e2d996282 (diff)
parent897404e4dde17e5f4c5c50f9cc734b02c2158835 (diff)
downloadtk-b16455219c1d8d926e0d2c7c21bab77f5f3cdeca.zip
tk-b16455219c1d8d926e0d2c7c21bab77f5f3cdeca.tar.gz
tk-b16455219c1d8d926e0d2c7c21bab77f5f3cdeca.tar.bz2
Fixed [011706ec42] for the scrollbar case
Diffstat (limited to 'tests')
-rw-r--r--tests/scrollbar.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 6da01ea..2a9fb4f 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -662,6 +662,43 @@ test scrollbar-10.2 {<MouseWheel> event on scrollbar} -constraints {win|unix} -s
destroy .t .s
} -result {1.4}
+test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body {
+ proc destroy_scrollbar {} {
+ if {[winfo exists .top.s]} {
+ destroy .top.s
+ }
+ }
+ toplevel .top
+ scrollbar .top.s
+ bind .top.s <2> {destroy_scrollbar}
+ pack .top.s
+ focus -force .top.s
+ update
+ event generate .top.s <2>
+ update ; # shall not trigger error invalid command name ".top.s"
+} -cleanup {
+ destroy .top.s .top
+} -result {}
+test scrollbar-11.2 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body {
+ proc destroy_scrollbar {{y 0}} {
+ if {[winfo exists .top.s]} {
+ destroy .top.s
+ }
+ }
+ toplevel .top
+ wm minsize .top 50 400
+ update
+ scrollbar .top.s
+ bind .top.s <2> {after idle destroy_scrollbar}
+ pack .top.s -expand true -fill y
+ focus -force .top.s
+ update
+ event generate .top.s <2> -x 2 -y [expr {[winfo height .top.s] / 2}]
+ update ; # shall not trigger error invalid command name ".top.s"
+} -cleanup {
+ destroy .top.s .top
+} -result {}
+
catch {destroy .s}
catch {destroy .t}