summaryrefslogtreecommitdiffstats
path: root/tests/button.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-03 17:24:52 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-03 17:24:52 (GMT)
commit24bc5ef7c2cec7c5f05169c1903fd481688960c1 (patch)
tree66d0ca9d971be9925bbc17c61534b9430d8fdf22 /tests/button.test
parentbd753872ec29b543f50c829134d11065533c5cf0 (diff)
parent473bb5cc9b6b28dc7dca5eb9d71b8da7bffac369 (diff)
downloadtk-24bc5ef7c2cec7c5f05169c1903fd481688960c1.zip
tk-24bc5ef7c2cec7c5f05169c1903fd481688960c1.tar.gz
tk-24bc5ef7c2cec7c5f05169c1903fd481688960c1.tar.bz2
Fixed [011706ec42] - tk::ButtonInvoke safety bug
Diffstat (limited to 'tests/button.test')
-rw-r--r--tests/button.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/button.test b/tests/button.test
index d28559a..28d8934 100644
--- a/tests/button.test
+++ b/tests/button.test
@@ -3908,6 +3908,24 @@ test button-13.8 {size behavior: checkbutton} -setup {
destroy .a .b .c
} -result {1 1 1}
+test button-14.1 {bug fix: [011706ec42] tk::ButtonInvoke unsafe wrt widget destruction} -body {
+ proc destroy_button {} {
+ if {[winfo exists .top.b]} {
+ destroy .top.b
+ }
+ }
+ toplevel .top
+ button .top.b -text Foo -command destroy_button
+ bind .top.b <space> destroy_button
+ pack .top.b
+ focus -force .top.b
+ update
+ event generate .top.b <space>
+ update ; # shall not trigger error invalid command name ".top.b"
+} -cleanup {
+ destroy .top.b .top
+} -result {}
+
imageFinish
cleanupTests
return