@@ -337,25 +337,22 @@ test scrollbar-3.41 {ScrollbarWidgetCmd procedure, "fraction" option} {
337
337
format {%.6g} [.t.s fraction 100 0]
338
338
} {0.5}
339
339
340
- #
341
- # COMMON TEST SETUP
342
- #
343
- if {[testConstraint testmetrics]} {
344
- # Only Windows has [testmetrics]
345
- place configure .t.s -width [expr {2*[testmetrics cxhscroll .t.s]+1}]
346
- } else {
347
- if {[tk windowingsystem] eq "x11"} {
348
- place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}]
340
+ test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} -setup {
341
+ if {[testConstraint testmetrics]} {
342
+ # Only Windows has [testmetrics]
343
+ place configure .t.s -width [expr {2*[testmetrics cxhscroll .t.s]+1}]
349
344
} else {
350
- # macOS aqua
351
- place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}]
345
+ if {[tk windowingsystem] eq "x11"} {
346
+ place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}]
347
+ } else {
348
+ # macOS aqua
349
+ place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}]
350
+ }
352
351
}
353
- }
354
- update
355
-
356
- test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} {
352
+ update
353
+ } -body {
357
354
format {%.6g} [.t.s fraction 100 0]
358
- } 0
355
+ } -result 0
359
356
360
357
#
361
358
# COMMON TEST CLEANUP
@@ -721,10 +718,9 @@ test scrollbar-8.2 {TkScrollbarEventProc: recursive deletion} notAqua {
721
718
} {1 0 1}
722
719
723
720
#
724
- # COMMON TEST SETUP
721
+ # COMMON TEST CLEANUP
725
722
#
726
723
727
- set l [interp hidden]
728
724
deleteWindows
729
725
730
726
test scrollbar-9.1 {scrollbar widget vs hidden commands} {
@@ -733,7 +729,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} {
733
729
interp hide {} .s
734
730
destroy .s
735
731
list [winfo children .] [interp hidden]
736
- } [list {} $l ]
732
+ } [list {} [interp hidden] ]
737
733
738
734
test scrollbar-10.1 {<MouseWheel> event on scrollbar} -setup {
739
735
destroy .t .s
0 commit comments