summaryrefslogtreecommitdiffstats
path: root/tests/listbox.test
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2015-12-30 22:07:25 (GMT)
committerfvogel <fvogel@noemail.net>2015-12-30 22:07:25 (GMT)
commit2c988b42c6033445b02a442a143a022240c58e13 (patch)
tree68708ba015126d246d37ff11db06016f4733180a /tests/listbox.test
parent88a2ec52c0403f619ded36af5e0fa7ecb7e0d356 (diff)
downloadtk-2c988b42c6033445b02a442a143a022240c58e13.zip
tk-2c988b42c6033445b02a442a143a022240c58e13.tar.gz
tk-2c988b42c6033445b02a442a143a022240c58e13.tar.bz2
Fixed bug [1288433] - LisboxSelect event triggers when listbox state is disabled
FossilOrigin-Name: cba57e096749c486bd614335030777bc79160f0c
Diffstat (limited to 'tests/listbox.test')
-rw-r--r--tests/listbox.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/listbox.test b/tests/listbox.test
index b4046b6..b01652b 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -2169,6 +2169,30 @@ test listbox-30.1 {Bug 3607326} -setup {
unset -nocomplain a
} -result * -match glob -returnCodes error
+test listbox-31.1 {<<ListboxSelect>> event} -setup {
+ destroy .l
+ unset -nocomplain res
+} -body {
+ pack [listbox .l -state normal]
+ update
+ bind .l <<ListboxSelect>> {lappend res [%W curselection]}
+ .l insert end a b c
+ focus -force .l
+ event generate .l <1> -x 5 -y 5 ; # <<ListboxSelect>> fires
+ .l configure -state disabled
+ focus -force .l
+ event generate .l <Control-Home> ; # <<ListboxSelect>> does NOT fire
+ .l configure -state normal
+ focus -force .l
+ event generate .l <Control-End> ; # <<ListboxSelect>> fires
+ .l selection clear 0 end ; # <<ListboxSelect>> does NOT fire
+ .l selection set 1 1 ; # <<ListboxSelect>> does NOT fire
+ lappend res [.l curselection]
+} -cleanup {
+ destroy .l
+ unset -nocomplain res
+} -result {0 2 1}
+
resetGridInfo
deleteWindows
option clear