summaryrefslogtreecommitdiffstats
path: root/tests/scale.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scale.test')
-rw-r--r--tests/scale.test114
1 files changed, 51 insertions, 63 deletions
diff --git a/tests/scale.test b/tests/scale.test
index 13ccb4d..87b4768 100644
--- a/tests/scale.test
+++ b/tests/scale.test
@@ -42,13 +42,13 @@ test scale-1.4 {configuration options} -body {
.s configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test scale-1.5 {configuration options} -body {
- .s configure -bd 4
- .s cget -bd
+ .s configure -borderwidth 4
+ .s cget -borderwidth
} -cleanup {
- .s configure -bd [lindex [.s configure -bd] 3]
+ .s configure -borderwidth [lindex [.s configure -borderwidth] 3]
} -result {4}
test scale-1.6 {configuration options} -body {
- .s configure -bd badValue
+ .s configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test scale-1.7 {configuration options} -body {
.s configure -bigincrement 12.5
@@ -60,13 +60,13 @@ test scale-1.8 {configuration options} -body {
.s configure -bigincrement badValue
} -returnCodes error -result {expected floating-point number but got "badValue"}
test scale-1.9 {configuration options} -body {
- .s configure -bg #ff0000
- .s cget -bg
+ .s configure -background #ff0000
+ .s cget -background
} -cleanup {
- .s configure -bg [lindex [.s configure -bg] 3]
+ .s configure -background [lindex [.s configure -background] 3]
} -result {#ff0000}
test scale-1.10 {configuration options} -body {
- .s configure -bg non-existent
+ .s configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test scale-1.11 {configuration options} -body {
.s configure -borderwidth 1.3
@@ -102,13 +102,13 @@ test scale-1.18 {configuration options} -body {
.s configure -digits badValue
} -returnCodes error -result {expected integer but got "badValue"}
test scale-1.19 {configuration options} -body {
- .s configure -fg #00ff00
- .s cget -fg
+ .s configure -foreground #00ff00
+ .s cget -foreground
} -cleanup {
- .s configure -fg [lindex [.s configure -fg] 3]
+ .s configure -foreground [lindex [.s configure -foreground] 3]
} -result {#00ff00}
test scale-1.20 {configuration options} -body {
- .s configure -fg badValue
+ .s configure -foreground badValue
} -returnCodes error -result {unknown color name "badValue"}
test scale-1.21 {configuration options} -body {
.s configure -font fixed
@@ -319,7 +319,6 @@ test scale-1.70 {configuration options} -body {
} -returnCodes error -result {bad screen distance "badValue"}
destroy .s
-
test scale-2.1 {Tk_ScaleCmd procedure} -body {
scale
} -returnCodes error -result {wrong # args: should be "scale pathName ?-option value ...?"}
@@ -367,8 +366,8 @@ test scale-3.7 {ScaleWidgetCmd procedure, configure option} -body {
.s configure -foo
} -returnCodes error -result {unknown option "-foo"}
test scale-3.8 {ScaleWidgetCmd procedure, configure option} -body {
- .s configure -borderwidth 2 -bg
-} -returnCodes error -result {value for "-bg" missing}
+ .s configure -borderwidth 2 -background
+} -returnCodes error -result {value for "-background" missing}
test scale-3.9 {ScaleWidgetCmd procedure, coords option} -body {
.s coords a b
} -returnCodes error -result {wrong # args: should be ".s coords ?value?"}
@@ -493,7 +492,6 @@ test scale-3.32 {ScaleWidgetCmd procedure, Tk_Preserve} -setup {
destroy .s
} -result {}
-
test scale-4.1 {DestroyScale procedure} -setup {
deleteWindows
} -body {
@@ -505,7 +503,6 @@ test scale-4.1 {DestroyScale procedure} -setup {
list [catch {set x foo} msg] $msg $x
} -result {0 foo foo}
-
test scale-5.1 {ConfigureScale procedure} -setup {
deleteWindows
} -body {
@@ -530,7 +527,7 @@ test scale-5.2 {ConfigureScale procedure} -setup {
test scale-5.3 {ConfigureScale procedure} -setup {
deleteWindows
} -body {
- catch {unset x}
+ unset -nocomplain x
scale .s -from 0 -to 100 -variable x
set result $x
lappend result [.s get]
@@ -690,7 +687,6 @@ test scale-6.20 {ComputeFormat procedure} -body {
} -result {1001.235}
destroy .s
-
test scale-7.1 {ComputeScaleGeometry procedure} -constraints {
nonPortable fonts
} -setup {
@@ -733,7 +729,7 @@ test scale-7.4 {ComputeScaleGeometry procedure} -constraints {
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -bd 5 \
+ scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -borderwidth 5 \
-relief sunken
pack .s
update
@@ -781,7 +777,7 @@ test scale-7.7 {ComputeScaleGeometry procedure} -constraints {
test scale-7.8 {ComputeScaleGeometry procedure} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 1000 -orient horizontal -showvalue 0 -bd 5 \
+ scale .s -from 0 -to 1000 -orient horizontal -showvalue 0 -borderwidth 5 \
-relief raised -highlightthickness 2
pack .s
update
@@ -790,13 +786,12 @@ test scale-7.8 {ComputeScaleGeometry procedure} -setup {
deleteWindows
} -result {114 39}
-
test scale-8.1 {ScaleElement procedure} -constraints {
fonts
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
+ scale .s -from 0 -to 100 -orient vertical -borderwidth 1 -tick 20 -length 300
pack .s
.s set 30
update
@@ -810,7 +805,7 @@ test scale-8.2 {ScaleElement procedure} -constraints {
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
+ scale .s -from 0 -to 100 -orient vertical -borderwidth 1 -tick 20 -length 300
pack .s
.s set 30
update
@@ -824,7 +819,7 @@ test scale-8.3 {ScaleElement procedure} -constraints {
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
+ scale .s -from 0 -to 100 -orient vertical -borderwidth 1 -tick 20 -length 300
pack .s
.s set 30
update
@@ -836,7 +831,7 @@ test scale-8.3 {ScaleElement procedure} -constraints {
test scale-8.4 {ScaleElement procedure} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient vertical -bd 4 -width 10 \
+ scale .s -from 0 -to 100 -orient vertical -borderwidth 4 -width 10 \
-highlightthickness 1 -length 300 -showvalue 0
pack .s
.s set 30
@@ -851,7 +846,7 @@ test scale-8.5 {ScaleElement procedure} -constraints {
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient horizontal -bd 1 \
+ scale .s -from 0 -to 100 -orient horizontal -borderwidth 1 \
-highlightthickness 2 -tick 20 -sliderlength 20 \
-length 200 -label Test
pack .s
@@ -867,7 +862,7 @@ test scale-8.6 {ScaleElement procedure} -constraints {
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient horizontal -bd 2 \
+ scale .s -from 0 -to 100 -orient horizontal -borderwidth 2 \
-highlightthickness 1 -tick 20 -length 200
pack .s
.s set 30
@@ -880,7 +875,7 @@ test scale-8.6 {ScaleElement procedure} -constraints {
test scale-8.7 {ScaleElement procedure} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient horizontal -bd 4 -highlightthickness 2 \
+ scale .s -from 0 -to 100 -orient horizontal -borderwidth 4 -highlightthickness 2 \
-length 200 -width 10 -showvalue 0
pack .s
.s set 30
@@ -893,7 +888,7 @@ test scale-8.7 {ScaleElement procedure} -setup {
test scale-8.8 {ScaleElement procedure} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \
+ scale .s -from 0 -to 100 -orient horizontal -borderwidth 1 -highlightthickness 2 \
-tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
pack .s
.s set 30
@@ -906,7 +901,7 @@ test scale-8.8 {ScaleElement procedure} -setup {
test scale-8.9 {ScaleElement procedure} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \
+ scale .s -from 0 -to 100 -orient horizontal -borderwidth 1 -highlightthickness 2 \
-tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
pack .s
.s set 80
@@ -922,60 +917,59 @@ test scale-8.9 {ScaleElement procedure} -setup {
destroy .s
pack [scale .s]
test scale-9.1 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get 46 0
} -result 0
test scale-9.2 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 9
} -result 0
test scale-9.3 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 12
} -result 1
test scale-9.4 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 46
} -result 35
test scale-9.5 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 110
} -result 99
test scale-9.6 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 111
} -result 100
test scale-9.7 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 112
} -result 100
test scale-9.8 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
update
.s get -10 154
} -result 100
test scale-9.9 {PixelToValue procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal
update
.s get 76 152
} -result 65
destroy .s
-
test scale-10.1 {ValueToPixel procedure} -constraints {
fonts
} -setup {
deleteWindows
} -body {
- scale .s -from 0 -to 100 -sliderlength 20 -length 124 -bd 2 \
+ scale .s -from 0 -to 100 -sliderlength 20 -length 124 -borderwidth 2 \
-orient horizontal -label Test -tick 20
pack .s
update
@@ -988,7 +982,7 @@ test scale-10.2 {ValueToPixel procedure} -constraints {
} -setup {
deleteWindows
} -body {
- scale .s -from 100 -to 0 -sliderlength 20 -length 122 -bd 1 \
+ scale .s -from 100 -to 0 -sliderlength 20 -length 122 -borderwidth 1 \
-orient vertical -label Test -tick 20
pack .s
update
@@ -997,7 +991,6 @@ test scale-10.2 {ValueToPixel procedure} -constraints {
deleteWindows
} -result {{62 114} {62 74} {62 14}}
-
test scale-11.1 {ScaleEventProc procedure} -setup {
deleteWindows
} -body {
@@ -1025,10 +1018,10 @@ test scale-11.2 {ScaleEventProc procedure} -setup {
deleteWindows
set x {}
} -body {
- scale .s1 -bg #543210
+ scale .s1 -background #543210
rename .s1 .s2
lappend x [winfo children .]
- lappend x [.s2 cget -bg]
+ lappend x [.s2 cget -background]
destroy .s1
lappend x [info command .s*] [winfo children .]
} -cleanup {
@@ -1100,85 +1093,84 @@ destroy .s
pack [scale .s]
update
test scale-14.1 {RoundToResolution procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 84 152
} -result 72
test scale-14.2 {RoundToResolution procedure} -body {
- .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 86 152
} -result 76
test scale-14.3 {RoundToResolution procedure} -body {
- .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 84 152
} -result 28
test scale-14.4 {RoundToResolution procedure} -body {
- .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 86 152
} -result 24
test scale-14.5 {RoundToResolution procedure} -body {
- .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from -100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 84 152
} -result {-28}
test scale-14.6 {RoundToResolution procedure} -body {
- .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from -100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 86 152
} -result {-24}
test scale-14.7 {RoundToResolution procedure} -body {
- .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to -100 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 84 152
} -result {-72}
test scale-14.8 {RoundToResolution procedure} -body {
- .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to -100 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 4.0
update
.s get 86 152
} -result {-76}
test scale-14.9 {RoundToResolution procedure} -body {
- .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 0
update
.s get 84 152
} -result {1.64}
test scale-14.10 {RoundToResolution procedure} -body {
- .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 0
update
.s get 86 152
} -result {1.69}
test scale-14.11 {RoundToResolution procedure} -body {
- .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 225 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 0 -digits 5
update
.s get 84 152
} -result {164.25}
test scale-14.12 {RoundToResolution procedure} -body {
- .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \
+ .s configure -from 0 -to 225 -sliderlength 10 -length 114 -borderwidth 2 \
-orient horizontal -resolution 0 -digits 5
update
.s get 86 152
} -result {168.75}
destroy .s
-
test scale-15.1 {ScaleVarProc procedure} -setup {
deleteWindows
} -body {
@@ -1269,7 +1261,6 @@ test scale-15.8 {ScaleVarProc procedure, don't call -command} -setup {
deleteWindows
} -result {untouched 60}
-
test scale-16.1 {scale widget vs hidden commands} -body {
set l [interp hidden]
deleteWindows
@@ -1283,7 +1274,6 @@ test scale-16.1 {scale widget vs hidden commands} -body {
deleteWindows
} -result 1
-
test scale-17.1 {bug fix 1786} -setup {
deleteWindows
} -body {
@@ -1306,7 +1296,6 @@ test scale-17.1 {bug fix 1786} -setup {
deleteWindows
} -result {100}
-
test scale-18.1 {DestroyScale, -cursor option [Bug: 3897]} -setup {
deleteWindows
} -body {
@@ -1356,7 +1345,6 @@ test scale-18.3 {Scale button 2 events [Bug 787065]} -setup {
destroy .s
} -result {0 {}}
-
option clear
# cleanup