summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-18 10:14:33 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-18 10:14:33 (GMT)
commit19cc8176bca15f76ec939274d61230b3108449f2 (patch)
treec0dc7bbe0c0f44ef9fe25376c27a5d029f49807e /tests
parent76481a4de12f52773cfeff0fea2f66eeb77ea1e6 (diff)
downloadtk-19cc8176bca15f76ec939274d61230b3108449f2.zip
tk-19cc8176bca15f76ec939274d61230b3108449f2.tar.gz
tk-19cc8176bca15f76ec939274d61230b3108449f2.tar.bz2
Fixed [011706ec42] for the scrollbar case.
Diffstat (limited to 'tests')
-rw-r--r--tests/scrollbar.test23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 8f967ea..bd14067 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -669,8 +669,8 @@ test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destructi
}
}
toplevel .top
- scrollbar .top.s -command destroy_scrollbar
- bind .top.s <2> destroy_scrollbar
+ scrollbar .top.s
+ bind .top.s <2> {destroy_scrollbar}
pack .top.s
focus -force .top.s
update
@@ -679,6 +679,25 @@ test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destructi
} -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}