summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-02-06 23:28:09 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-02-06 23:28:09 (GMT)
commit522151de45f6a75c19e39af1e8530999c99ee2bf (patch)
tree9dc2a027de1a9f66b6a5516a1a570c3054889cb1 /tests
parent9502fe89d75c03f9bb6e407d6acc8ae2ff0114b6 (diff)
downloadtk-522151de45f6a75c19e39af1e8530999c99ee2bf.zip
tk-522151de45f6a75c19e39af1e8530999c99ee2bf.tar.gz
tk-522151de45f6a75c19e39af1e8530999c99ee2bf.tar.bz2
Change -empty* option names to -placeholder*. Changes provided by René Zaumseil
Diffstat (limited to 'tests')
-rw-r--r--tests/entry.test16
-rw-r--r--tests/ttk/entry.test37
2 files changed, 45 insertions, 8 deletions
diff --git a/tests/entry.test b/tests/entry.test
index 82e4fd2..6a1a22f 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -627,20 +627,20 @@ test entry-1.58 {configuration option: "xscrollcommand" for entry} -setup {
destroy .e
} -result {Some command}
-test entry-1.59 {configuration option: "emptytext"} -setup {
+test entry-1.59 {configuration option: "-placeholdertext"} -setup {
pack [entry .e]
} -body {
- .e configure -emptytext {Some text}
- .e cget -emptytext
+ .e configure -placeholdertext {Some text}
+ .e cget -placeholdertext
} -cleanup {
destroy .e
} -result {Some text}
-test entry-1.60 {configuration option: "emptyforeground"} -setup {
+test entry-1.60 {configuration option: "-placeholderforeground"} -setup {
pack [entry .e]
} -body {
- .e configure -emptytext {Some text} -emptyforeground red
- .e cget -emptyforeground
+ .e configure -placeholdertext {Some text} -placeholderforeground red
+ .e cget -placeholderforeground
} -cleanup {
destroy .e
} -result {red}
@@ -3519,10 +3519,10 @@ test entry-24.1 {textvariable lives in a non-existing namespace} -setup {
destroy .e
} -result {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist}
-test entry-25.1 {emptytext on/off shown} -setup {
+test entry-25.1 {-placeholdertext on/off shown} -setup {
pack [entry .e]
} -body {
- .e configure -emptytext {empty} -textvariable ::_e
+ .e configure -placeholdertext {placeholder} -textvariable ::_e
update; after 1000
set ::_e entry
update; after 1000
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index d95ef31..5cfdfee 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -280,4 +280,41 @@ test entry-9.1 "Index range invariants" -setup {
destroy .e
}
+test entry-10.1 {configuration option: "-placeholdertext"} -setup {
+ pack [entry .e]
+} -body {
+ .e configure -placeholdertext {Some text}
+ .e cget -placeholdertext
+} -cleanup {
+ destroy .e
+} -result {Some text}
+
+test entry-10.2 {style option: "-placeholderforeground"} -setup {
+ pack [entry .e]
+} -body {
+ ttk::style configure TEntry -foreground red
+ .e configure -placeholdertext {Some text}
+ update
+ ttk::style configure TEntry -foreground #b3b3b3
+ update
+} -cleanup {
+ destroy .e
+} -result {}
+
+test entry-10.3 {placeholdertext on/off shown} -setup {
+ pack [entry .e]
+} -body {
+ .e configure -placeholdertext {placeholder} -textvariable ::_e
+ update; after 1000
+ set ::_e entry
+ update; after 1000
+ set ::_e {}
+ update; after 1000
+ set ::_e entry
+ update; after 1000
+} -cleanup {
+ destroy .e
+ unset ::_e
+} -result {}
+
tcltest::cleanupTests