summaryrefslogtreecommitdiffstats
path: root/tests/listbox.test
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2016-01-11 13:23:20 (GMT)
committerfvogel <fvogel@noemail.net>2016-01-11 13:23:20 (GMT)
commit835ddec0738a87e5579e2d00c79e5b2702edbe07 (patch)
tree87dfd77a94fb45488edde792e3b0735459a1fea7 /tests/listbox.test
parent87c62e6cc857c4bf118499b683334e67b9da76ff (diff)
parentcc784b877bf7b144c0fc36ca7c9f5c18622e75d6 (diff)
downloadtk-835ddec0738a87e5579e2d00c79e5b2702edbe07.zip
tk-835ddec0738a87e5579e2d00c79e5b2702edbe07.tar.gz
tk-835ddec0738a87e5579e2d00c79e5b2702edbe07.tar.bz2
merged trunk
FossilOrigin-Name: d9f9c7f55fbd47c56311974aa6cae706349608c7
Diffstat (limited to 'tests/listbox.test')
-rw-r--r--tests/listbox.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/listbox.test b/tests/listbox.test
index 72b1cdf..0519e93 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -3068,6 +3068,45 @@ 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}
+
+test listbox-31.2 {<<ListboxSelect>> event on lost selection} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l -exportselection true]
+ update
+ bind .l <<ListboxSelect>> {lappend res [list [selection own] [%W curselection]]}
+ .l insert end a b c
+ focus -force .l
+ event generate .l <1> -x 5 -y 5 ; # <<ListboxSelect>> fires
+ selection clear ; # <<ListboxSelect>> fires again
+ set res
+} -cleanup {
+ destroy .l
+} -result {{.l 0} {{} {}}}
+
resetGridInfo
deleteWindows
option clear