Import Tk 8.6.11

This commit is contained in:
Steve Dower
2021-03-30 00:54:10 +01:00
parent 42c69189d9
commit 070b8750b0
403 changed files with 21608 additions and 16269 deletions

View File

@@ -39,7 +39,7 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} {
# Shift by height of tearoff entry minus height of window titlebar
catch {incr y [expr {[$w yposition 1] - 16}]}
# Avoid the native menu bar which sits on top of everything.
if {$y < 22} { set y 22 }
if {$y < 22} {set y 22}
}
}
@@ -153,9 +153,11 @@ proc ::tk::MenuDup {src dst type} {
# Copy tags to x, replacing each substring of src with dst.
while {[set index [string first $src $tags]] != -1} {
append x [string range $tags 0 [expr {$index - 1}]]$dst
set tags [string range $tags [expr {$index + $srcLen}] end]
while {[set index [string first $src $tags]] >= 0} {
if {$index > 0} {
append x [string range $tags 0 $index-1]$dst
}
set tags [string range $tags $index+$srcLen end]
}
append x $tags
@@ -168,10 +170,12 @@ proc ::tk::MenuDup {src dst type} {
# Copy script to x, replacing each substring of event with dst.
while {[set index [string first $event $script]] != -1} {
append x [string range $script 0 [expr {$index - 1}]]
while {[set index [string first $event $script]] >= 0} {
if {$index > 0} {
append x [string range $script 0 $index-1]
}
append x $dst
set script [string range $script [expr {$index + $eventLen}] end]
set script [string range $script $index+$eventLen end]
}
append x $script