summaryrefslogtreecommitdiffstats
path: root/tests/unixButton.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-07-13 20:28:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-07-13 20:28:35 (GMT)
commit05961d4dc9e4b65d07feac195998ca0f969b06d9 (patch)
tree83ce372d1ae9d46d27acc5638739bddcbc8e6ba6 /tests/unixButton.test
parent511415799ba6bf2ec3e5d90c57dfbb61da8c6da1 (diff)
downloadtk-05961d4dc9e4b65d07feac195998ca0f969b06d9.zip
tk-05961d4dc9e4b65d07feac195998ca0f969b06d9.tar.gz
tk-05961d4dc9e4b65d07feac195998ca0f969b06d9.tar.bz2
* Converted more files to tcltest and factored out common code.
Diffstat (limited to 'tests/unixButton.test')
-rw-r--r--tests/unixButton.test37
1 files changed, 14 insertions, 23 deletions
diff --git a/tests/unixButton.test b/tests/unixButton.test
index 6b1bcbb..85f9259 100644
--- a/tests/unixButton.test
+++ b/tests/unixButton.test
@@ -8,23 +8,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: unixButton.test,v 1.4 2002/07/12 13:40:59 dgp Exp $
+# RCS: @(#) $Id: unixButton.test,v 1.5 2002/07/13 20:28:35 dgp Exp $
package require tcltest 2.1
-namespace import -force tcltest::test
-namespace import -force tcltest::testConstraint
-namespace import -force tcltest::testsDirectory
namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands
-eval configure $argv
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -58,7 +49,7 @@ pack .l .b .c .r
update
test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {unix testImageType} {
- eval destroy [winfo children .]
+ deleteWindows
image create test image1
image1 changed 0 0 0 0 60 40
label .b1 -image image1 -bd 4 -padx 0 -pady 2
@@ -73,7 +64,7 @@ test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {unix testImageType} {
[winfo reqwidth .b4] [winfo reqheight .b4]
} {68 48 74 54 112 52 112 52}
test unixbutton-1.2 {TkpComputeButtonGeometry procedure} unix {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -bitmap question -bd 3 -padx 0 -pady 2
button .b2 -bitmap question -bd 3 -padx 0 -pady 2
checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1
@@ -86,7 +77,7 @@ test unixbutton-1.2 {TkpComputeButtonGeometry procedure} unix {
[winfo reqwidth .b4] [winfo reqheight .b4]
} {23 33 29 39 54 37 54 37}
test unixbutton-1.3 {TkpComputeButtonGeometry procedure} unix {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -bitmap question -bd 3 -highlightthickness 4
button .b2 -bitmap question -bd 3 -highlightthickness 0
checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
@@ -101,7 +92,7 @@ test unixbutton-1.3 {TkpComputeButtonGeometry procedure} unix {
[winfo reqwidth .b4] [winfo reqheight .b4]
} {31 41 25 35 25 35 25 35}
test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -text Xagqpim -padx 0 -pady 2 -font {Helvetica -18 bold}
button .b2 -text Xagqpim -padx 0 -pady 2 -font {Helvetica -18 bold}
checkbutton .b3 -text Xagqpim -padx 1 -pady 1 -font {Helvetica -18 bold}
@@ -114,21 +105,21 @@ test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts
[winfo reqwidth .b4] [winfo reqheight .b4]
} {82 29 88 35 114 31 121 29}
test unixbutton-1.5 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
- eval destroy [winfo children .]
+ deleteWindows
label .l1 -text "This is a long string that will wrap around on several lines.\n\nIt also has a blank line (above)." -wraplength 1.5i -padx 0 -pady 0
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
} {136 88}
test unixbutton-1.6 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
- eval destroy [winfo children .]
+ deleteWindows
label .l1 -text "This is a long string without wrapping.\n\nIt also has a blank line (above)." -padx 0 -pady 0
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
} {231 46}
test unixbutton-1.7 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -width 10
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -height 5
checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -width 20 -height 2
@@ -141,7 +132,7 @@ test unixbutton-1.7 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts
[winfo reqwidth .b4] [winfo reqheight .b4]
} {74 22 60 84 168 38 61 22}
test unixbutton-1.8 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
-highlightthickness 4
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
@@ -157,22 +148,22 @@ test unixbutton-1.8 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts
[winfo reqwidth .b4] [winfo reqheight .b4]
} {62 30 56 24 58 22 62 22}
test unixbutton-1.9 {TkpComputeButtonGeometry procedure} unix {
- eval destroy [winfo children .]
+ deleteWindows
button .b2 -bitmap question -default active
list [winfo reqwidth .b2] [winfo reqheight .b2]
} {37 47}
test unixbutton-1.10 {TkpComputeButtonGeometry procedure} unix {
- eval destroy [winfo children .]
+ deleteWindows
button .b2 -bitmap question -default normal
list [winfo reqwidth .b2] [winfo reqheight .b2]
} {37 47}
test unixbutton-1.11 {TkpComputeButtonGeometry procedure} unix {
- eval destroy [winfo children .]
+ deleteWindows
button .b2 -bitmap question -default disabled
list [winfo reqwidth .b2] [winfo reqheight .b2]
} {27 37}
-eval destroy [winfo children .]
+deleteWindows
# cleanup
::tcltest::cleanupTests