summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/text.test51
1 files changed, 49 insertions, 2 deletions
diff --git a/tests/text.test b/tests/text.test
index 07192e8..9e8ed9b 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6395,9 +6395,9 @@ test text-27.14a {<<Modified>> virtual event - propagation to peers} -body {
} -cleanup {
destroy .t .tt
} -result {4}
-test text-27.15 {<<Selection>> virtual event} -body {
+test text-27.15 {<<Selection>> virtual event on sel tagging} -body {
set ::retval no_selection
- pack [text .t -undo 1]
+ pack [text .t]
bind .t <<Selection>> "set ::retval selection_changed"
update idletasks
.t insert end "nothing special\n"
@@ -6407,6 +6407,53 @@ test text-27.15 {<<Selection>> virtual event} -body {
} -cleanup {
destroy .t
} -result {selection_changed}
+test text-27.15a {<<Selection>> virtual event on <<PasteSelection>>} -body {
+ pack [text .t -exportselection 1]
+ .t insert end "There is a PRIMARY selection in this text widget, "
+ .t insert end "and it will be impacted by the <<PasteSelection>> event received.\n"
+ .t insert end "Therefore a <<Selection>> event must fire back."
+ .t tag add sel 1.0 1.28
+ bind .t <<Selection>> "set ::retval <<Selection>>_fired"
+ update
+ set ::retval no_<<Selection>>_event_fired
+ event generate .t <<PasteSelection>> -x 15 -y 3
+ update
+ set ::retval
+} -cleanup {
+ destroy .t
+} -result {<<Selection>>_fired}
+test text-27.15b {<<Selection>> virtual event on <Delete>} -body {
+ pack [text .t -exportselection 1]
+ .t insert end "There is a PRIMARY selection in this text widget, "
+ .t insert end "and it will be impacted by the <Delete> event received.\n"
+ .t insert end "Therefore a <<Selection>> event must fire back."
+ .t tag add sel 1.0 1.28
+ bind .t <<Selection>> "set ::retval <<Selection>>_fired"
+ update
+ set ::retval no_<<Selection>>_event_fired
+ .t mark set insert 1.15
+ focus .t
+ event generate .t <Delete>
+ update
+ set ::retval
+} -cleanup {
+ destroy .t
+} -result {<<Selection>>_fired}
+test text-27.15c {<<Selection>> virtual event on <<Cut>>} -body {
+ pack [text .t -exportselection 1]
+ .t insert end "There is a PRIMARY selection in this text widget, "
+ .t insert end "and it will be impacted by the <<Cut>> event received.\n"
+ .t insert end "Therefore a <<Selection>> event must fire back."
+ .t tag add sel 1.0 1.28
+ bind .t <<Selection>> "set ::retval <<Selection>>_fired"
+ update
+ set ::retval no_<<Selection>>_event_fired
+ event generate .t <<Cut>>
+ update
+ set ::retval
+} -cleanup {
+ destroy .t
+} -result {<<Selection>>_fired}
test text-27.16 {-maxundo configuration option} -body {
text .t -undo 1 -autoseparators 1 -maxundo 2
pack .t