Import Tk 8.6.10
This commit is contained in:
@@ -4,16 +4,26 @@ loadTestedCommands
|
||||
|
||||
testConstraint coreScrollbar [expr {[tk windowingsystem] eq "aqua"}]
|
||||
|
||||
test scrollbar-swapout-1 "Use core scrollbars on OSX..." -constraints {
|
||||
coreScrollbar
|
||||
# Before 2019 the code in library/ttk/scrollbar.tcl would replace the
|
||||
# constructor of ttk::scrollbar with the constructor of tk::scrollbar
|
||||
# unless the -class or -style options were specified..
|
||||
# Now there is an implementation of ttk::scrollbar for macOS. The
|
||||
# tests are left in place, though, except that scrollbar-swapout-1
|
||||
# test was changed to expect the class to be TScrollbar instead of
|
||||
# Scrollbar.
|
||||
|
||||
test scrollbar-swapout-1 "Don't use core scrollbars on OSX..." \
|
||||
-constraints {
|
||||
coreScrollbar
|
||||
} -body {
|
||||
ttk::scrollbar .sb -command "yadda"
|
||||
list [winfo class .sb] [.sb cget -command]
|
||||
} -result [list Scrollbar yadda] -cleanup {
|
||||
} -result [list TScrollbar yadda] -cleanup {
|
||||
destroy .sb
|
||||
}
|
||||
|
||||
test scrollbar-swapout-2 "... unless -style is specified ..." -constraints {
|
||||
test scrollbar-swapout-2 "... regardless of whether -style ..." \
|
||||
-constraints {
|
||||
coreScrollbar
|
||||
} -body {
|
||||
ttk::style layout Vertical.Custom.TScrollbar \
|
||||
@@ -24,7 +34,7 @@ test scrollbar-swapout-2 "... unless -style is specified ..." -constraints {
|
||||
destroy .sb
|
||||
}
|
||||
|
||||
test scrollbar-swapout-3 "... or -class." -constraints {
|
||||
test scrollbar-swapout-3 "... or -class is specified." -constraints {
|
||||
coreScrollbar
|
||||
} -body {
|
||||
ttk::scrollbar .sb -command "yadda" -class Custom.TScrollbar
|
||||
@@ -44,13 +54,19 @@ test scrollbar-1.1 "Set method" -body {
|
||||
|
||||
test scrollbar-1.2 "Set orientation" -body {
|
||||
.tsb configure -orient vertical
|
||||
set w [winfo reqwidth .tsb] ; set h [winfo reqheight .tsb]
|
||||
pack .tsb -side right -anchor e -expand 1 -fill y
|
||||
wm geometry . 200x200
|
||||
update
|
||||
set w [winfo width .tsb] ; set h [winfo height .tsb]
|
||||
expr {$h > $w}
|
||||
} -result 1
|
||||
|
||||
test scrollbar-1.3 "Change orientation" -body {
|
||||
.tsb configure -orient horizontal
|
||||
set w [winfo reqwidth .tsb] ; set h [winfo reqheight .tsb]
|
||||
pack .tsb -side bottom -anchor s -expand 1 -fill x
|
||||
wm geometry . 200x200
|
||||
update
|
||||
set w [winfo width .tsb] ; set h [winfo height .tsb]
|
||||
expr {$h < $w}
|
||||
} -result 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user