summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-03-21 20:56:14 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-03-21 20:56:14 (GMT)
commit38465faf27a2dd1b680aab3787b30139a6f24094 (patch)
treef657c7ea708b042d55d0bedc1731eac46f0134e0 /tests
parent8356b50cc915367d0bf4cf242de5374d5055c28d (diff)
parent856e2b93a549f8c2a1195ba81c097d95ba381121 (diff)
downloadtk-38465faf27a2dd1b680aab3787b30139a6f24094.zip
tk-38465faf27a2dd1b680aab3787b30139a6f24094.tar.gz
tk-38465faf27a2dd1b680aab3787b30139a6f24094.tar.bz2
Merged tip-442 following positive vote by the TCT.
Diffstat (limited to 'tests')
-rw-r--r--tests/ttk/progressbar.test39
-rw-r--r--tests/ttk/ttk.test4
2 files changed, 41 insertions, 2 deletions
diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test
index b9add86..7c888c6 100644
--- a/tests/ttk/progressbar.test
+++ b/tests/ttk/progressbar.test
@@ -82,4 +82,43 @@ test progressbar-end "Cleanup" -body {
destroy .pb
}
+# check existence and default value of each non-core option of the widget
+test progressbar-3.1 "progressbar non-core options" -setup {
+ set res {}
+ ttk::progressbar .defaultpb
+} -body {
+ foreach option {-anchor -foreground -justify -style -text -wraplength \
+ -length -maximum -mode -orient -phase -value -variable} {
+ lappend res [.defaultpb cget $option]
+ }
+ set res
+} -cleanup {
+ unset res
+ destroy .defaultpb
+} -result {w black left {} {} 0 100 100 determinate horizontal 0 0.0 {}}
+
+test progressbar-3.2 "TIP #442 options are taken into account" -setup {
+ set res {}
+ pack [ttk::progressbar .p -value 0 -maximum 50 -orient horizontal -mode determinate -length 500]
+ set thefont [font actual {Arial 10}]
+} -body {
+ .p configure -anchor c -foreground blue -justify right \
+ -text "TIP #442\noptions are now tested" -wraplength 100
+ update
+ .p step 10
+ .p configure -anchor e -font $thefont -foreground green -justify center \
+ -text "Changing the value of each option\nfrom TIP #442" -wraplength 250
+ update
+ .p step 20
+ .p configure -orient vertical -text "Cannot be seen"
+ update
+ foreach option {-anchor -foreground -justify -text -wraplength} {
+ lappend res [list $option [.p cget $option]]
+ }
+ set res
+} -cleanup {
+ unset res thefont
+ destroy .p
+} -result {{-anchor e} {-foreground green} {-justify center} {-text {Cannot be seen}} {-wraplength 250}}
+
tcltest::cleanupTests
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index 93dba34..6760b80 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -134,8 +134,8 @@ test ttk-selfdestruct-ok-1 "Intentional self-destruction" -body {
#
# Basic tests.
#
-test ttk-1.1 "Create button" -body {
- pack [ttk::button .t] -expand true -fill both
+test ttk-1.1 "Create multiline button showing justified text" -body {
+ pack [ttk::button .t -text "Hello\nWorld!!" -justify center] -expand true -fill both
update
}