From 793de68ddb8db3284f76e14e93d789056b6ded58 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Apr 2022 12:43:47 +0000 Subject: Stabilize textDisp-19.4. This test was observed failing once at GitHub Actions, in branch bug-dc4c5573a6, on macOS, with clang (no, --disable-aqua). Call proc delay instead of proc updateText since this was more or less the previous scheme, see [30586d4fe984848c]. --- tests/textDisp.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index c56ca26..9c4e0e9 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2836,7 +2836,7 @@ test textDisp-19.14 {GetYView procedure} { # Need to update so everything is calculated. updateText .t count -update -ypixels 1.0 end - updateText + delay set scrollInfo "unchanged" .t mark set insert 3.0 .t tag configure x -background red -- cgit v0.12 From d4335ec7f05a4df601e1cd93d994633f6d65e957 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Apr 2022 17:11:33 +0000 Subject: Stabilize spinbox-5.7. This test was observed failing once at GitHub Actions, in branch bug-dc4c5573a6, on macOS, with clang (mem, --enable-aqua). Further analysis shows that the expected result in this test is wrong (from day one!), and that when the test fails it produces the correct result! Fix: use proc updateSpin instead of vwaiting on scrollInfo. --- tests/spinbox.test | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/spinbox.test b/tests/spinbox.test index e4f1c5e..025e375 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -14,6 +14,18 @@ tcltest::loadTestedCommands testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}] +# Platform specific procedure for updating the spinbox widget. + +if {[tk windowingsystem] == "aqua"} { + proc updateSpin {} { + update idletasks + } +} else { + proc updateSpin {} { + update + } +} + # For xscrollcommand set scrollInfo {} proc scroll args { @@ -2017,15 +2029,14 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e configure -width 5 - vwait scrollInfo + updateSpin format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout -} -result {0.000000 0.363636} +} -result {0.000000 0.454545} test spinbox-5.8 {ConfigureSpinbox procedure} -constraints { fonts -- cgit v0.12 From 4bf719b52c4f8f984ad916775955a52e10b39fc7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Apr 2022 17:17:22 +0000 Subject: Propagate previous scheme to other spinbox tests that were vwaiting on scrollInfo. --- tests/spinbox.test | 61 ++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/tests/spinbox.test b/tests/spinbox.test index 025e375..530c4e1 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -2220,14 +2220,13 @@ test spinbox-7.1 {InsertChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e insert 2 XXX - vwait scrollInfo + updateSpin list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abXXXcde abXXXcde {0.000000 1.000000}} test spinbox-7.2 {InsertChars procedure} -setup { @@ -2238,14 +2237,13 @@ test spinbox-7.2 {InsertChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e insert 500 XXX - vwait scrollInfo + updateSpin list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abcdeXXX abcdeXXX {0.000000 1.000000}} test spinbox-7.3 {InsertChars procedure} -setup { spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -2373,14 +2371,13 @@ test spinbox-8.1 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e delete 2 4 - vwait scrollInfo + updateSpin list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abe abe {0.000000 1.000000}} test spinbox-8.2 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2390,14 +2387,13 @@ test spinbox-8.2 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e delete -1 2 - vwait scrollInfo + updateSpin list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {cde cde {0.000000 1.000000}} test spinbox-8.3 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2407,14 +2403,13 @@ test spinbox-8.3 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e delete 3 1000 - vwait scrollInfo + updateSpin list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abc abc {0.000000 1.000000}} test spinbox-8.4 {DeleteChars procedure} -setup { spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -3194,41 +3189,38 @@ test spinbox-16.2 {SpinboxVisibleRange procedure} -body { test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e delete 0 end .e insert 0 123 - vwait scrollInfo + updateSpin format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout } -result {0.000000 1.000000} test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 0123456789abcdef - update idletasks - set timeout [after 500 {set $scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e xview 3 - vwait scrollInfo + updateSpin format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout } -result {0.187500 0.812500} test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateSpin + set scrollInfo wrong .e insert 0 abcdefghijklmnopqrs .e xview - vwait scrollInfo + updateSpin format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout } -result {0.000000 0.526316} test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup { proc bgerror msg { @@ -3238,9 +3230,10 @@ test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup { } -body { spinbox .e -width 5 pack .e - update idletasks + updateSpin + set scrollInfo wrong .e configure -xscrollcommand thisisnotacommand - vwait x + updateSpin list $x $errorInfo } -cleanup { destroy .e -- cgit v0.12 From 085a42d47c0042dbc6bf9babc45c99da38f699d2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Apr 2022 17:25:03 +0000 Subject: Propagate previous scheme to entry tests (including the fix in the expected result of entry-5.7. --- tests/entry.test | 84 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/tests/entry.test b/tests/entry.test index d67980a..942a5c5 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -15,6 +15,18 @@ testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match L testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}] testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] +# Platform specific procedure for updating the entry widget. + +if {[tk windowingsystem] == "aqua"} { + proc updateEntry {} { + update idletasks + } +} else { + proc updateEntry {} { + update + } +} + # For xscrollcommand set scrollInfo {} proc scroll args { @@ -1676,15 +1688,14 @@ test entry-5.7 {ConfigureEntry procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateEntry + set scrollInfo wrong .e configure -width 5 - vwait scrollInfo + updateEntry format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout -} -result {0.000000 0.363636} +} -result {0.000000 0.454545} test entry-5.8 {ConfigureEntry procedure} -constraints { @@ -1922,14 +1933,14 @@ test entry-7.1 {InsertChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateEntry + set scrollInfo wrong .e insert 0 abcde .e insert 2 XXX - vwait scrollInfo + updateEntry list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abXXXcde abXXXcde {0.000000 1.000000}} test entry-7.2 {InsertChars procedure} -setup { @@ -1939,14 +1950,14 @@ test entry-7.2 {InsertChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateEntry + set scrollInfo wrong .e insert 0 abcde .e insert 500 XXX - vwait scrollInfo + updateEntry list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abcdeXXX abcdeXXX {0.000000 1.000000}} test entry-7.3 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -2073,14 +2084,14 @@ test entry-8.1 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateEntry + set scrollInfo wrong .e insert 0 abcde .e delete 2 4 - vwait scrollInfo + updateEntry list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abe abe {0.000000 1.000000}} test entry-8.2 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2089,14 +2100,14 @@ test entry-8.2 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateEntry + set scrollInfo wrong .e insert 0 abcde .e delete -1 2 - vwait scrollInfo + updateEntry list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {cde cde {0.000000 1.000000}} test entry-8.3 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2105,14 +2116,14 @@ test entry-8.3 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + updateEntry + set scrollInfo wrong .e insert 0 abcde .e delete 3 1000 - vwait scrollInfo + updateEntry list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e - after cancel $timeout } -result {abc abc {0.000000 1.000000}} test entry-8.4 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -2942,41 +2953,39 @@ test entry-16.4 {EntryVisibleRange procedure} -body { test entry-17.1 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} - pack .e ; update idletasks - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + pack .e + updateEntry + set scrollInfo wrong .e delete 0 end .e insert 0 123 - vwait scrollInfo + updateEntry format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout } -result {0.000000 1.000000} test entry-17.2 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} - pack .e ; update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + pack .e + updateEntry + set scrollInfo wrong .e insert 0 0123456789abcdef .e xview 3 - vwait scrollInfo + updateEntry format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout } -result {0.187500 0.812500} test entry-17.3 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} - pack .e ; update idletasks - update idletasks - set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] + pack .e + updateEntry + set scrollInfo wrong .e insert 0 abcdefghijklmnopqrs .e xview 6 - vwait scrollInfo + updateEntry format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e - after cancel $timeout } -result {0.315789 0.842105} test entry-17.4 {EntryUpdateScrollbar procedure} -setup { proc bgerror msg { @@ -2985,10 +2994,11 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup { } } -body { entry .e -width 5 - pack .e ; update idletasks - update idletasks + pack .e + updateEntry + set scrollInfo wrong .e configure -xscrollcommand thisisnotacommand - vwait x + updateEntry list $x $errorInfo } -cleanup { destroy .e -- cgit v0.12 From a6c092d5fa9383090b0adc130f41c4a91124a9b6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 6 Apr 2022 20:25:02 +0000 Subject: Stabilize panedwindow-23.30. This test was observed failing at least three times at GitHub Actions, in branch bug-dc4c5573a6, less_tests_constraints_revised_text, and unstable_tests, all on macOS, respectively with clang (mem, --enable-aqua), xcode, and clang (mem, --enable-aqua). A second 'update' is needed to set the mapping state of .f4 because it does not fit in the width of the panedwindow. --- tests/panedwindow.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index bb3a7fd..89708e7 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4941,6 +4941,10 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { .p add .f1 .f2 .f3 .f4 pack .p update + # On macOS, the above update does the job of mapping .p and its children + # but then getting the correct mapping state (0) of .f4 needs another + # update because .f4 does not fit in the width of .p + update set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] -- cgit v0.12 From 62cd8775a8f649f0762666411ee3dd3d2352ce21 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 6 Apr 2022 20:38:01 +0000 Subject: Fix indentation in panedwindow.test --- tests/panedwindow.test | 1398 ++++++++++++++++++++++++------------------------ 1 file changed, 699 insertions(+), 699 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 89708e7..4ffcbe2 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -293,17 +293,17 @@ deleteWindows test panedwindow-2.1 {panedwindow widget command} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p foo } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash} test panedwindow-3.1 {panedwindow panes subcommand} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] @@ -312,20 +312,20 @@ test panedwindow-3.1 {panedwindow panes subcommand} -setup { .p forget .b lappend result [.p panes] } -cleanup { - deleteWindows + deleteWindows } -result [list [list .b .c] [list .c]] test panedwindow-4.1 {forget subcommand} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p forget } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p forget widget ?widget ...?"} test panedwindow-4.2 {forget subcommand, forget one from start} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] @@ -334,10 +334,10 @@ test panedwindow-4.2 {forget subcommand, forget one from start} -setup { .p forget .b lappend result [.p panes] } -cleanup { - deleteWindows + deleteWindows } -result [list {.b .c} .c] test panedwindow-4.3 {forget subcommand, forget one from end} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] @@ -348,10 +348,10 @@ test panedwindow-4.3 {forget subcommand, forget one from end} -setup { update lappend result [.p panes] } -cleanup { - deleteWindows + deleteWindows } -result [list {.b .c .d} {.b .c}] test panedwindow-4.4 {forget subcommand, forget multiple} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] @@ -362,10 +362,10 @@ test panedwindow-4.4 {forget subcommand, forget multiple} -setup { update lappend result [.p panes] } -cleanup { - deleteWindows + deleteWindows } -result [list {.b .c .d} .d] test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] @@ -377,10 +377,10 @@ test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup { update lappend result [winfo ismapped .b] [winfo ismapped .c] } -cleanup { - deleteWindows + deleteWindows } -result [list 1 1 0 1] test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false .p add [frame .f -width 20 -height 20] [frame .g -width 20 -height 20] @@ -388,244 +388,244 @@ test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup .p forget .f lappend result [winfo reqwidth .p] } -cleanup { - deleteWindows + deleteWindows } -result [list 44 20] test panedwindow-5.1 {sash subcommand} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p sash option ?arg ...?"} test panedwindow-5.2 {sash subcommand} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash foo } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {bad option "foo": must be coord, dragto, mark, or place} test panedwindow-6.1 {sash coord subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash coord } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p sash coord index"} test panedwindow-6.2 {sash coord subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {invalid sash index} test panedwindow-6.3 {sash coord subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash coord foo } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-6.4 {sash coord subcommand sashes correctly placed} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 22 0] test panedwindow-6.5 {sash coord subcommand sashes correctly placed} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 50 0] test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \ -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 22] test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \ -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 50] test panedwindow-6.8 {sash coord subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p list [catch {.p sash coord -1} msg] $msg \ [catch {.p sash coord 0} msg] $msg \ [catch {.p sash coord 1} msg] $msg } -cleanup { - deleteWindows + deleteWindows } -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"] test panedwindow-6.9 {sash coord subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { # There are no sashes until you have 2 panes panedwindow .p .p add [frame .p.f] list [catch {.p sash coord -1} msg] $msg \ - [catch {.p sash coord 0} msg] $msg \ - [catch {.p sash coord 1} msg] $msg + [catch {.p sash coord 0} msg] $msg \ + [catch {.p sash coord 1} msg] $msg } -cleanup { - deleteWindows + deleteWindows } -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"] test panedwindow-6.10 {sash coord subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { # There are no sashes until you have 2 panes panedwindow .p .p add [frame .p.f] [frame .p.f2] list [catch {.p sash coord -1} msg] $msg \ - [catch {.p sash coord 0} msg] \ - [catch {.p sash coord 1} msg] $msg \ - [catch {.p sash coord 2} msg] $msg + [catch {.p sash coord 0} msg] \ + [catch {.p sash coord 1} msg] $msg \ + [catch {.p sash coord 2} msg] $msg } -cleanup { - deleteWindows + deleteWindows } -result [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"] test panedwindow-7.1 {sash mark subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash mark } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p sash mark index ?x y?"} test panedwindow-7.2 {sash mark subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash mark foo } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-7.3 {sash mark subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash mark 0 foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {invalid sash index} test panedwindow-7.4 {sash mark subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash mark 0 foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-7.5 {sash mark subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash mark 0 0 bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "bar"} test panedwindow-7.6 {sash mark subcommand, mark defaults to 0 0} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash mark 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 0] test panedwindow-7.7 {sash mark subcommand, set mark} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash mark 0 10 10 .p sash mark 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 10 10] test panedwindow-8.1 {sash dragto subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash dragto } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p sash dragto index x y"} test panedwindow-8.2 {sash dragto subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash dragto foo bar baz } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-8.3 {sash dragto subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash dragto 0 foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {invalid sash index} test panedwindow-8.4 {sash dragto subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash dragto 0 foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-8.5 {sash dragto subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash dragto 0 0 bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "bar"} test panedwindow-9.1 {sash mark/sash dragto interaction} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false .p add [frame .f -width 20 -height 20] [button .c -text foobar] @@ -633,10 +633,10 @@ test panedwindow-9.1 {sash mark/sash dragto interaction} -setup { .p sash dragto 0 20 10 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 30 0] test panedwindow-9.2 {sash mark/sash dragto interaction} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical \ -showhandle false @@ -645,10 +645,10 @@ test panedwindow-9.2 {sash mark/sash dragto interaction} -setup { .p sash dragto 0 10 20 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 30] test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false .p add [frame .f -width 20 -height 20] [button .c] -minsize 15 @@ -656,95 +656,95 @@ test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup { .p sash dragto 0 10 10 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 15 0] test panedwindow-10.1 {sash place subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash place } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p sash place index x y"} test panedwindow-10.2 {sash place subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash place foo bar baz } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-10.3 {sash place subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p sash place 0 foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {invalid sash index} test panedwindow-10.4 {sash place subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash place 0 foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-10.5 {sash place subcommand, errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p sash place 0 0 bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "bar"} test panedwindow-10.6 {sash place subcommand, moves sash} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 20] [button .c] .p sash place 0 10 0 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 10 0] test panedwindow-10.7 {sash place subcommand, moves sash} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical .p add [frame .f -width 20 -height 20] [button .c] .p sash place 0 0 10 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 10] test panedwindow-10.8 {sash place subcommand, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false .p add [frame .f -width 20 -height 20] [button .c] -minsize 15 .p sash place 0 10 0 .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 15 0] test panedwindow-10.9 {sash place subcommand, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [frame .f -width 20 -height 20 -bg pink] .p sash place 0 2 0 } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {invalid sash index} test panedwindow-11.1 {moving sash changes size of pane to left} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false .p add [frame .f -width 20 -height 20] [button .c -text foobar] -sticky nsew @@ -754,7 +754,7 @@ test panedwindow-11.1 {moving sash changes size of pane to left} -setup { winfo width .f } -result 30 test panedwindow-11.2 {moving sash changes size of pane to right} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20] @@ -765,10 +765,10 @@ test panedwindow-11.2 {moving sash changes size of pane to right} -setup { update lappend result [winfo width .f2] } -cleanup { - deleteWindows + deleteWindows } -result {20 10} test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20] @@ -776,7 +776,7 @@ test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setu winfo reqwidth .p } -result 44 test panedwindow-11.4 {moving sash changes size of pane above} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -788,7 +788,7 @@ test panedwindow-11.4 {moving sash changes size of pane above} -setup { set result } -result 20 test panedwindow-11.5 {moving sash changes size of pane below} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -801,10 +801,10 @@ test panedwindow-11.5 {moving sash changes size of pane below} -setup { lappend result [winfo height .f2] set result } -cleanup { - deleteWindows + deleteWindows } -result {10 5} test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -814,10 +814,10 @@ test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setu lappend result [winfo reqheight .p] set result } -cleanup { - deleteWindows + deleteWindows } -result [list 24 24] test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -826,10 +826,10 @@ test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup { .p sash place 0 0 20 lappend result [winfo reqheight .f] } -cleanup { - deleteWindows + deleteWindows } -result [list 10 10] test panedwindow-11.8 {moving sash restricted to minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 20] [button .c] -minsize 15 @@ -839,7 +839,7 @@ test panedwindow-11.8 {moving sash restricted to minsize} -setup { winfo width .f } -result 15 test panedwindow-11.9 {moving sash restricted to minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -850,7 +850,7 @@ test panedwindow-11.9 {moving sash restricted to minsize} -setup { winfo height .f } -result 10 test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] @@ -858,64 +858,64 @@ test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -s .p sash place 0 100 0 lappend result [.p sash coord 0] } -cleanup { - deleteWindows + deleteWindows } -result [list {20 0} {40 0}] test panedwindow-11.11 {moving sash right pushes other sashes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] .p sash place 0 80 0 list [.p sash coord 0] [.p sash coord 1] } -cleanup { - deleteWindows + deleteWindows } -result {{60 0} {64 0}} test panedwindow-11.12 {moving sash left pushes other sashes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] .p sash place 1 0 0 list [.p sash coord 0] [.p sash coord 1] } -cleanup { - deleteWindows + deleteWindows } -result {{0 0} {4 0}} test panedwindow-11.13 {move sash in mapped window restricted to visible win} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] place .p -width 50 update .p sash place 1 100 0 update .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result {46 0} test panedwindow-11.14 {move sash in mapped window restricted to visible win} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] place .p -width 100 update .p sash place 1 200 0 update .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result {96 0} test panedwindow-11.15 {moving sash into "virtual" space on last pane increases reqsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] place .p -width 100 set result [winfo reqwidth .p] update @@ -923,12 +923,12 @@ test panedwindow-11.15 {moving sash into "virtual" space on last pane increases update lappend result [winfo reqwidth .p] } -cleanup { - deleteWindows + deleteWindows } -result {68 100} test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup { - deleteWindows + deleteWindows set result {} } -body { panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 @@ -938,10 +938,10 @@ test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]} return $result } -cleanup { - deleteWindows + deleteWindows } -result [list 2 2 28 2 54 2] test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup { - deleteWindows + deleteWindows set result {} } -body { panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 \ @@ -952,15 +952,15 @@ test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup { foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]} return $result } -cleanup { - deleteWindows + deleteWindows } -result [list 2 2 2 18 2 34] test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach {win color} {.p.f blue .p.f2 green} { - .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \ - -sticky "" + .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \ + -sticky "" } pack .p update @@ -972,15 +972,15 @@ test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]} return $result } -cleanup { - deleteWindows + deleteWindows } -result [list 80 30 10 5 50 5 60 30 0 5 30 5] test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ -orient vertical foreach win {.p.f .p.f2} { - .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky "" + .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky "" } pack .p update @@ -992,10 +992,10 @@ test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup { foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]} return $result } -cleanup { - deleteWindows + deleteWindows } -result [list 40 60 10 5 10 35 40 50 10 0 10 25] test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 .p add [frame .p.f -width 20 -height 20] -sticky "" @@ -1006,10 +1006,10 @@ test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -set update lappend result [winfo width .p.f] } -cleanup { - deleteWindows + deleteWindows } -result [list 20 30] test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 .p add [frame .p.f -width 20 -height 20] -width 20 -sticky "" @@ -1020,10 +1020,10 @@ test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -s update lappend result [winfo width .p.f] } -cleanup { - deleteWindows + deleteWindows } -result [list 20 20] test panedwindow-12.7 {horizontal panedwindow reqheight is max pane height} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20] @@ -1031,10 +1031,10 @@ test panedwindow-12.7 {horizontal panedwindow reqheight is max pane height} -set .p.f config -height 40 lappend result [winfo reqheight .p] } -cleanup { - deleteWindows + deleteWindows } -result {20 40} test panedwindow-12.8 {horizontal panedwindow reqheight is max pane height} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]} @@ -1043,10 +1043,10 @@ test panedwindow-12.8 {horizontal panedwindow reqheight is max pane height} -set .p.f config -height 40 lappend result [winfo reqheight .p] } -cleanup { - deleteWindows + deleteWindows } -result {20 20} test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]} @@ -1057,10 +1057,10 @@ test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup { .p paneconfigure .p.f -width 30 lappend result [winfo width .p.f] } -cleanup { - deleteWindows + deleteWindows } -result [list 10 10] test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 .p add [frame .p.f -width 20 -height 20] -sticky "" @@ -1071,10 +1071,10 @@ test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -se update lappend result [winfo height .p.f] } -cleanup { - deleteWindows + deleteWindows } -result [list 20 30] test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 .p add [frame .p.f -width 20 -height 20] -height 20 -sticky "" @@ -1085,10 +1085,10 @@ test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup update lappend result [winfo height .p.f] } -cleanup { - deleteWindows + deleteWindows } -result [list 20 20] test panedwindow-12.12 {vertical panedwindow reqwidth is max pane width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -1097,10 +1097,10 @@ test panedwindow-12.12 {vertical panedwindow reqwidth is max pane width} -setup .p.f config -width 40 lappend result [winfo reqwidth .p] } -cleanup { - deleteWindows + deleteWindows } -result {20 40} test panedwindow-12.13 {vertical panedwindow reqwidth is max pane width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -1110,10 +1110,10 @@ test panedwindow-12.13 {vertical panedwindow reqwidth is max pane width} -setup .p.f config -width 40 lappend result [winfo reqwidth .p] } -cleanup { - deleteWindows + deleteWindows } -result {20 20} test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ -orient vertical @@ -1125,12 +1125,12 @@ test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup { .p paneconfigure .p.f -height 30 lappend result [winfo height .p.f] } -cleanup { - deleteWindows + deleteWindows } -result [list 10 10] test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup { - deleteWindows + deleteWindows } -body { # Check that the panedwindow correctly yields geometry management of # a pane when the pane is destroyed. @@ -1145,7 +1145,7 @@ test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup { set result "" } -result {} test panedwindow-13.2 {PanedWindowLostPaneProc, widget yields management} -setup { - deleteWindows + deleteWindows } -body { # Check that the paned window correctly yields geometry management of # a pane when some other geometry manager steals the pane from us. @@ -1495,7 +1495,7 @@ test panedwindow-15.16 {panedwindow sticky works} -setup { test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .p.f -height 20 -width 20 -bg red] @@ -1503,17 +1503,17 @@ test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setu .p paneconfigure .p.f -minsize 40 lappend result [winfo reqwidth .p] } -cleanup { - deleteWindows + deleteWindows } -result [list 20 40] test panedwindow-17.1 {MoveSash, move right} -setup { - deleteWindows + deleteWindows set result {} } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1527,14 +1527,14 @@ test panedwindow-17.1 {MoveSash, move right} -setup { # Check that the sash moved lappend result [.p sash coord 0] } -cleanup { - deleteWindows + deleteWindows } -result [list 42 42 {30 0}] test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 100 0 @@ -1543,14 +1543,14 @@ test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -set # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 40 0] test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a width < reqwidth @@ -1563,14 +1563,14 @@ test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped b # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 30 0] test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a width > reqwidth @@ -1583,14 +1583,14 @@ test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped b # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 100 0] test panedwindow-17.5 {MoveSash, move right respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 100 0 @@ -1599,14 +1599,14 @@ test panedwindow-17.5 {MoveSash, move right respects minsize} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 30 0] test panedwindow-17.6 {MoveSash, move right respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 100 0 @@ -1614,14 +1614,14 @@ test panedwindow-17.6 {MoveSash, move right respects minsize} -setup { # Get the new sash coord; it should have moved as far as possible. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 40 0] test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 100 0 @@ -1630,14 +1630,14 @@ test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup { # respecting minsizes. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 62 0] test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 100 0 @@ -1646,15 +1646,15 @@ test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsiz # respecting minsizes. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 52 0] test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -padx 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -padx 5 } .p sash place 0 100 0 @@ -1663,15 +1663,15 @@ test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setu # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 50 0] test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 0 50 0 @@ -1680,15 +1680,15 @@ test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup # respecting minsizes. list [.p sash coord 0] [.p sash coord 1] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 50 0] [list 52 0]] test panedwindow-17.11 {MoveSash, move left} -setup { - deleteWindows + deleteWindows } -body { set result {} panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1702,14 +1702,14 @@ test panedwindow-17.11 {MoveSash, move left} -setup { # Check that the sash moved lappend result [.p sash coord 0] } -cleanup { - deleteWindows + deleteWindows } -result [list 42 42 {10 0}] test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 -100 0 @@ -1718,14 +1718,14 @@ test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setu # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 0] test panedwindow-17.13 {MoveSash, move left respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 0 @@ -1734,14 +1734,14 @@ test panedwindow-17.13 {MoveSash, move left respects minsize} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 10 0] test panedwindow-17.14 {MoveSash, move left respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -1749,14 +1749,14 @@ test panedwindow-17.14 {MoveSash, move left respects minsize} -setup { # Get the new sash coord; it should have moved as far as possible. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 22 0] test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 1 0 0 @@ -1765,14 +1765,14 @@ test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 0] test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -1781,15 +1781,15 @@ test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsiz # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 10 0] test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -padx 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -padx 5 } .p sash place 1 0 0 @@ -1798,15 +1798,15 @@ test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setu # respecting minsizes. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 42 0] test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue green} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 1 10 0 @@ -1815,18 +1815,18 @@ test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup # respecting minsizes. list [.p sash coord 0] [.p sash coord 1] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 8 0] [list 10 0]] test panedwindow-18.1 {MoveSash, move down} -setup { - deleteWindows + deleteWindows } -body { set result {} panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1840,15 +1840,15 @@ test panedwindow-18.1 {MoveSash, move down} -setup { # Check that the sash moved lappend result [.p sash coord 0] } -cleanup { - deleteWindows + deleteWindows } -result [list 42 42 {0 30}] test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 0 100 @@ -1857,15 +1857,15 @@ test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -set # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 40] test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a height < reqheight @@ -1878,15 +1878,15 @@ test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 30] test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a width > reqwidth @@ -1899,15 +1899,15 @@ test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 100] test panedwindow-18.5 {MoveSash, move down respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 100 @@ -1916,15 +1916,15 @@ test panedwindow-18.5 {MoveSash, move down respects minsize} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 30] test panedwindow-18.6 {MoveSash, move down respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 100 @@ -1933,15 +1933,15 @@ test panedwindow-18.6 {MoveSash, move down respects minsize} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 40] test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 0 100 @@ -1950,15 +1950,15 @@ test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup { # respecting minsizes. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 62] test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 100 @@ -1967,16 +1967,16 @@ test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize # respecting minsizes. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 52] test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -pady 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -pady 5 } .p sash place 0 0 100 @@ -1985,16 +1985,16 @@ test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 50] test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 0 0 50 @@ -2003,16 +2003,16 @@ test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup # respecting minsizes. list [.p sash coord 0] [.p sash coord 1] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 0 50] [list 0 52]] test panedwindow-18.11 {MoveSash, move up} -setup { - deleteWindows + deleteWindows } -body { set result {} panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -2026,15 +2026,15 @@ test panedwindow-18.11 {MoveSash, move up} -setup { # Check that the sash moved lappend result [.p sash coord 0] } -cleanup { - deleteWindows + deleteWindows } -result [list 42 42 {0 10}] test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 0 -100 @@ -2043,15 +2043,15 @@ test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup # the panedwindow. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 0] test panedwindow-18.13 {MoveSash, move up respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 0 @@ -2060,15 +2060,15 @@ test panedwindow-18.13 {MoveSash, move up respects minsize} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 10] test panedwindow-18.14 {MoveSash, move up respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -2076,15 +2076,15 @@ test panedwindow-18.14 {MoveSash, move up respects minsize} -setup { # Get the new sash coord; it should have moved as far as possible. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 22] test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 1 0 0 @@ -2093,15 +2093,15 @@ test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup { # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 0] test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -2110,16 +2110,16 @@ test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} # respecting minsizes. .p sash coord 0 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 10] test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -pady 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -pady 5 } .p sash place 1 0 0 @@ -2128,16 +2128,16 @@ test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup # respecting minsizes. .p sash coord 1 } -cleanup { - deleteWindows + deleteWindows } -result [list 0 42] test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical foreach w {.f1 .f2 .f3} c {red blue green} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 1 0 10 @@ -2146,7 +2146,7 @@ test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup { # respecting minsizes. list [.p sash coord 0] [.p sash coord 1] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 0 8] [list 0 10]] @@ -2155,90 +2155,90 @@ test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup { # geometry. test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .f3 configure -height 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 60 20] [list 60 40]] test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -height 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 60 20] [list 60 40]] test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -pady 20 + .p add [frame $w -width 20 -height 20 -bg blue] -pady 20 } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -height 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 60 60] [list 60 80]] test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .f3 configure -width 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 20 60] [list 40 60]] test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -width 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 20 60] [list 40 60]] test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -padx 20 + .p add [frame $w -width 20 -height 20 -bg blue] -padx 20 } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -width 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] } -cleanup { - deleteWindows + deleteWindows } -result [list [list 60 60] [list 80 60]] test panedwindow-19.7 {ComputeGeometry, one pane, reqsize set properly} -setup { @@ -4308,21 +4308,21 @@ test panedwindow-19.134 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [frame .f -width 20 -height 20 -bg blue] destroy .f .p panes } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] + [frame .f2 -width 20 -height 20 -bg red] destroy .f winfo reqwidth .p } -cleanup { @@ -4331,11 +4331,11 @@ test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup { test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -width 100 -x 0 -y 0 update winfo width .f2 @@ -4343,12 +4343,12 @@ test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -set deleteWindows } -result 78 test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -height 100 -x 0 -y 0 update winfo height .f2 @@ -4356,51 +4356,51 @@ test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -set deleteWindows } -result 78 test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky "" + [frame .f2 -width 20 -height 20 -bg red] -sticky "" .p paneconfigure .f1 -width 10 -height 15 pack .p update list [winfo width .f1] [winfo height .f1] } -cleanup { - deleteWindows + deleteWindows } -result {10 15} test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] + [frame .f2 -width 20 -height 20 -bg red] .p sash place 0 10 0 pack .p update list [winfo width .f1] [winfo height .f1] } -cleanup { - deleteWindows + deleteWindows } -result {10 20} test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] + [frame .f2 -width 20 -height 20 -bg red] .p sash place 0 0 10 pack .p update list [winfo width .f1] [winfo height .f1] } -cleanup { - deleteWindows + deleteWindows } -result {20 10} test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 20 -height 40 -bg red] -sticky "" + [frame .p.f2 -width 20 -height 40 -bg red] -sticky "" pack .p update winfo y .p.f1 @@ -4408,12 +4408,12 @@ test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -se deleteWindows } -result 10 test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 40 -height 40 -bg red] -sticky "" + [frame .p.f2 -width 40 -height 40 -bg red] -sticky "" pack .p update winfo x .p.f1 @@ -4421,11 +4421,11 @@ test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setu deleteWindows } -result 10 test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 40 -bg red] + [frame .f2 -width 20 -height 40 -bg red] pack .p update set result [winfo ismapped .f1] @@ -4433,14 +4433,14 @@ test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup update lappend result [winfo ismapped .f1] } -cleanup { - deleteWindows + deleteWindows } -result {1 0} test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 20 -height 40 -bg red] + [frame .p.f2 -width 20 -height 40 -bg red] pack .p update set result [winfo ismapped .p.f1] @@ -4448,14 +4448,14 @@ test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup update lappend result [winfo ismapped .p.f1] } -cleanup { - deleteWindows + deleteWindows } -result {1 0} test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 20 -height 40 -bg red] + [frame .p.f2 -width 20 -height 40 -bg red] pack .p update set result [winfo ismapped .p.f1] @@ -4463,14 +4463,14 @@ test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup update lappend result [winfo ismapped .p.f1] } -cleanup { - deleteWindows + deleteWindows } -result {1 0} test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -width 40 -x 0 -y 0 update winfo width .f2 @@ -4478,12 +4478,12 @@ test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup { deleteWindows } -result 18 test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ -orient vertical .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -height 40 -x 0 -y 0 update winfo height .f2 @@ -4491,67 +4491,67 @@ test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup { deleteWindows } -result 18 test panedwindow-21.13 {ArrangePanes, panedwindow resizes} -setup { - deleteWindows + deleteWindows } -body { - panedwindow .p -width 200 -borderwidth 0 - frame .f1 -height 50 -bg blue - set result [list] - lappend result [winfo reqwidth .p] [winfo reqheight .p] - .p add .f1 - pack .p - lappend result [winfo reqwidth .p] [winfo reqheight .p] + panedwindow .p -width 200 -borderwidth 0 + frame .f1 -height 50 -bg blue + set result [list] + lappend result [winfo reqwidth .p] [winfo reqheight .p] + .p add .f1 + pack .p + lappend result [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows } -result {200 1 200 50} test panedwindow-21.14 {ArrangePanes, panedwindow resizes} -setup { - deleteWindows + deleteWindows } -body { - panedwindow .p -height 200 -borderwidth 0 -orient vertical - frame .f1 -width 50 -bg blue - set result [list] - lappend result [winfo reqwidth .p] [winfo reqheight .p] - .p add .f1 - pack .p - lappend result [winfo reqwidth .p] [winfo reqheight .p] + panedwindow .p -height 200 -borderwidth 0 -orient vertical + frame .f1 -width 50 -bg blue + set result [list] + lappend result [winfo reqwidth .p] [winfo reqheight .p] + .p add .f1 + pack .p + lappend result [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows } -result {1 200 50 200} test panedwindow-21.15 {ArrangePanes, last pane grows} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -height 50 - .p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \ - [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green] - .p sash place 1 250 0 - pack .p - update - set result [list] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] - .p configure -width 300 - update - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + deleteWindows +} -body { + panedwindow .p -showhandle false -height 50 + .p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \ + [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green] + .p sash place 1 250 0 + pack .p + update + set result [list] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] [winfo width .p] + .p configure -width 300 + update + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] [winfo width .p] } -cleanup { deleteWindows } -result {50 150 1 1 211 50 150 1 89 300} test panedwindow-22.1 {PanedWindowReqProc, react to pane geometry changes} -setup { - deleteWindows + deleteWindows } -body { # Basically just want to make sure that the PanedWindowReqProc is called panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 40 -bg red] + [frame .f2 -width 20 -height 40 -bg red] set result [winfo reqheight .p] .f1 configure -height 80 lappend result [winfo reqheight .p] } -cleanup { - deleteWindows + deleteWindows } -result {40 80} test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 10] [frame .f2 -width 10] @@ -4561,97 +4561,97 @@ test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setu destroy .p .f1 .f2 expr {[lindex $result 1] - [lindex $result 0]} } -cleanup { - deleteWindows + deleteWindows } -result {10} test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add .p } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {can't add .p to itself} test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add .b } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {bad window path name ".b"} test panedwindow-23.3 {ConfigurePanes, bad window aborts processing} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .b catch {.p add .b .a} .p panes } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-23.4 {ConfigurePanes, bad option aborts processing} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .b catch {.p add .b -sticky foobar} .p panes } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-23.5 {ConfigurePanes, after win isn't managed by panedwin} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .b button .c .p add .b -after .c } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {window ".c" is not managed by .p} test panedwindow-23.6 {ConfigurePanes, before win isn't managed by panedwin} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .b button .c .p add .b -before .c } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {window ".c" is not managed by .p} test panedwindow-23.7 {ConfigurePanes, -after {} is a no-op} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p paneconfigure .b -after {} .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.b .c} test panedwindow-23.8 {ConfigurePanes, -before {} is a no-op} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p paneconfigure .b -before {} .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.b .c} test panedwindow-23.9 {ConfigurePanes, new panes are added} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.b .c} test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] [button .c] -sticky ne -height 5 -width 5 -minsize 10 @@ -4665,22 +4665,22 @@ test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup { } return $result } -cleanup { - deleteWindows + deleteWindows } -result {.b {-sticky ne -height 5 -width 5 -minsize 10} .c {-sticky ne -height 5 -width 5 -minsize 10}} test panedwindow-23.11 {ConfigurePanes, existing panes are reconfigured} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] -sticky nw -height 10 .p add .b [button .c] -sticky se -height 2 list [.p panes] [.p panecget .b -sticky] [.p panecget .b -height] \ - [.p panecget .c -sticky] [.p panecget .c -height] + [.p panecget .c -sticky] [.p panecget .c -height] } -cleanup { - deleteWindows + deleteWindows } -result [list {.b .c} es 2 es 2] test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p add [button .b] @@ -4688,10 +4688,10 @@ test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup .p add [button .d] .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.b .c .d} test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4702,10 +4702,10 @@ test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup { .p add .c -after .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.a .c .b} test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4717,10 +4717,10 @@ test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup { .p add .c .d -after .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.a .c .d .b} test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4732,10 +4732,10 @@ test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setu .p add .d -after .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.a .d .b .c} test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4747,10 +4747,10 @@ test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -set .p add .b .d -after .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.a .b .d .c} test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4762,10 +4762,10 @@ test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -set .p add .d .a -after .b .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.b .d .a .c} test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4777,10 +4777,10 @@ test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -set .p add .d .a -after .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.d .a .b .c} test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4792,10 +4792,10 @@ test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup { .p add .d -after .c .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.a .b .c .d} test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4807,10 +4807,10 @@ test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup { .p add .d -before .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.d .a .b .c} test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .a @@ -4822,10 +4822,10 @@ test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -set .p add .d .b -before .a .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.d .b .a .c} test panedwindow-23.22 {ConfigurePanes, pane specified multiple times} -setup { - deleteWindows + deleteWindows } -body { # This test should not cause a core dump @@ -4837,10 +4837,10 @@ test panedwindow-23.22 {ConfigurePanes, pane specified multiple times} -setup { .p add .a .a .b .c .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.a .b .c} test panedwindow-23.23 {ConfigurePanes, pane specified multiple times} -setup { - deleteWindows + deleteWindows } -body { # This test should not cause a core dump @@ -4853,48 +4853,48 @@ test panedwindow-23.23 {ConfigurePanes, pane specified multiple times} -setup { .p add .a .b .a -after .c .p panes } -cleanup { - deleteWindows + deleteWindows } -result {.c .a .b} test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p toplevel .t .p add .t } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {can't add toplevel .t to .p} test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p frame .f button .f.b .p add .f.b } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {can't add .f.b to .p} test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup { - deleteWindows + deleteWindows } -body { frame .f panedwindow .f.p button .b .f.p add .b } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-23.27 {ConfigurePanes, restrict possible panes} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p button .p.b .p add .p.b } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup { - deleteWindows + deleteWindows } -body { frame .f frame .f.f @@ -4903,64 +4903,64 @@ test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup { button .b .f.f.f.p add .b } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-23.29 {ConfigurePanes, -hide works} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false - frame .f1 -width 40 -height 100 -bg red - frame .f2 -width 40 -height 100 -bg white - frame .f3 -width 40 -height 100 -bg blue - frame .f4 -width 40 -height 100 -bg green - .p add .f1 .f2 .f3 .f4 - pack .p - update - set result [list] - lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + deleteWindows +} -body { + panedwindow .p -showhandle false + frame .f1 -width 40 -height 100 -bg red + frame .f2 -width 40 -height 100 -bg white + frame .f3 -width 40 -height 100 -bg blue + frame .f4 -width 40 -height 100 -bg green + .p add .f1 .f2 .f3 .f4 + pack .p + update + set result [list] + lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ + [winfo ismapped .f3] [winfo ismapped .f4] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] [winfo width .p] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ + [winfo ismapped .f3] [winfo ismapped .f4] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] [winfo width .p] } -cleanup { deleteWindows } -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128} test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -width 130 -height 100 - frame .f1 -width 40 -bg red - frame .f2 -width 40 -bg white - frame .f3 -width 40 -bg blue - frame .f4 -width 40 -bg green - .p add .f1 .f2 .f3 .f4 - pack .p - update - # On macOS, the above update does the job of mapping .p and its children - # but then getting the correct mapping state (0) of .f4 needs another - # update because .f4 does not fit in the width of .p - update - set result [list] - lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + deleteWindows +} -body { + panedwindow .p -showhandle false -width 130 -height 100 + frame .f1 -width 40 -bg red + frame .f2 -width 40 -bg white + frame .f3 -width 40 -bg blue + frame .f4 -width 40 -bg green + .p add .f1 .f2 .f3 .f4 + pack .p + update + # On macOS, the above update does the job of mapping .p and its children + # but then getting the correct mapping state (0) of .f4 needs another + # update because .f4 does not fit in the width of .p + update + set result [list] + lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ + [winfo ismapped .f3] [winfo ismapped .f4] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] [winfo width .p] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ + [winfo ismapped .f3] [winfo ismapped .f4] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] [winfo width .p] } -cleanup { deleteWindows } -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130} test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p1 -sashrelief raised panedwindow .p2 -sashrelief raised @@ -4972,151 +4972,151 @@ test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup { .p1 add .p2 -sticky nsew .p1 add .l1 -sticky nsew pack .p1 -side top -expand 1 -fill both - update - set result [list] - lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + update + set result [list] + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] .p2 paneconfigure .l1 -hide 1 - update - lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] .p1 paneconfigure .p2 -hide 1 - update - lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] .p1 paneconfigure .p2 -hide 0 - update - lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] } -cleanup { deleteWindows } -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}} test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0 - frame .f1 -width 50 -bg red - frame .f2 -width 50 -bg green - frame .f3 -width 50 -bg blue - .p add .f1 .f2 .f3 - pack .p - update - set result [list] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] - .p paneconfigure .f2 -hide 1 - update + deleteWindows +} -body { + panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0 + frame .f1 -width 50 -bg red + frame .f2 -width 50 -bg green + frame .f3 -width 50 -bg blue + .p add .f1 .f2 .f3 + pack .p + update + set result [list] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] + .p paneconfigure .f2 -hide 1 + update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] } -cleanup { deleteWindows } -result {50 50 94 50 50 147} test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -width 200 -height 200 \ - -borderwidth 0 -orient vertical - frame .f1 -height 50 -bg red - frame .f2 -height 50 -bg green - frame .f3 -height 50 -bg blue - .p add .f1 .f2 .f3 - pack .p - update - set result [list] - lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3] + deleteWindows +} -body { + panedwindow .p -showhandle false -width 200 -height 200 \ + -borderwidth 0 -orient vertical + frame .f1 -height 50 -bg red + frame .f2 -height 50 -bg green + frame .f3 -height 50 -bg blue + .p add .f1 .f2 .f3 + pack .p + update + set result [list] + lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3] } -cleanup { deleteWindows } -result {50 50 94 50 50 147} test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -height 100 -width 182 - frame .f1 -width 40 -bg red - frame .f2 -width 40 -bg white - frame .f3 -width 40 -bg blue - frame .f4 -width 40 -bg green - .p add .f1 .f2 .f3 .f4 -stretch first - pack .p - update - set result [list] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + deleteWindows +} -body { + panedwindow .p -showhandle false -height 100 -width 182 + frame .f1 -width 40 -bg red + frame .f2 -width 40 -bg white + frame .f3 -width 40 -bg blue + frame .f4 -width 40 -bg green + .p add .f1 .f2 .f3 .f4 -stretch first + pack .p + update + set result [list] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] } -cleanup { deleteWindows } -result {51 40 40 40 94 40 40 40} test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -height 100 -width 182 - frame .f1 -width 40 -bg red - frame .f2 -width 40 -bg white - frame .f3 -width 40 -bg blue - frame .f4 -width 40 -bg green - .p add .f1 .f2 .f3 .f4 -stretch middle - pack .p - update - set result [list] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + deleteWindows +} -body { + panedwindow .p -showhandle false -height 100 -width 182 + frame .f1 -width 40 -bg red + frame .f2 -width 40 -bg white + frame .f3 -width 40 -bg blue + frame .f4 -width 40 -bg green + .p add .f1 .f2 .f3 .f4 -stretch middle + pack .p + update + set result [list] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] } -cleanup { deleteWindows } -result {40 45 46 40 40 45 94 40} test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -height 100 -width 182 - frame .f1 -width 40 -bg red - frame .f2 -width 40 -bg white - frame .f3 -width 40 -bg blue - frame .f4 -width 40 -bg green - .p add .f1 .f2 .f3 .f4 -stretch always - pack .p - update - set result [list] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + deleteWindows +} -body { + panedwindow .p -showhandle false -height 100 -width 182 + frame .f1 -width 40 -bg red + frame .f2 -width 40 -bg white + frame .f3 -width 40 -bg blue + frame .f4 -width 40 -bg green + .p add .f1 .f2 .f3 .f4 -stretch always + pack .p + update + set result [list] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] } -cleanup { deleteWindows } -result {42 43 43 43 58 43 58 58} test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup { - deleteWindows -} -body { - panedwindow .p -showhandle false -height 100 -width 182 - frame .f1 -width 40 -bg red - frame .f2 -width 40 -bg white - frame .f3 -width 40 -bg blue - frame .f4 -width 40 -bg green - .p add .f1 .f2 .f3 .f4 -stretch never - pack .p - update - set result [list] - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] - .p paneconfigure .f2 -hide 1 - update - lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + deleteWindows +} -body { + panedwindow .p -showhandle false -height 100 -width 182 + frame .f1 -width 40 -bg red + frame .f2 -width 40 -bg white + frame .f3 -width 40 -bg blue + frame .f4 -width 40 -bg green + .p add .f1 .f2 .f3 .f4 -stretch never + pack .p + update + set result [list] + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] + .p paneconfigure .f2 -hide 1 + update + lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ + [winfo width .f4] } -cleanup { deleteWindows } -result {40 40 40 40 40 40 40 40} test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup { - deleteWindows + deleteWindows } -body { # Bug 928413 set result {} @@ -5133,20 +5133,20 @@ test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup { .pw paneconfigure .pw.l2 -before .pw.l1 lappend result [.pw panecget .pw.l2 -before] } -cleanup { - deleteWindows + deleteWindows } -result {.pw.l3 {} .pw.l1} test panedwindow-25.1 {DestroyPanedWindow} -setup { - deleteWindows + deleteWindows } -body { # This test should not result in any memory leaks. panedwindow .p foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .q .r .s .t} { - .p add [button $w] + .p add [button $w] } foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .p .q .r .s .t} { - destroy $w + destroy $w } set result {} } -result {} @@ -5169,307 +5169,307 @@ test panedwindow-25.2 {UnmapNotify and MapNotify events are propagated to panes} destroy .pw .pw.b set result } -cleanup { - deleteWindows + deleteWindows } -result {1 0 0 1 1} test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 0 } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 20 0 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 22 0 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 24 0 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 26 0 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 26 -1 } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 26 100 } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 + -handlesize 6 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 22 4 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 + -handlesize 6 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 22 5 } -cleanup { - deleteWindows + deleteWindows } -result {0 handle} test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 + -handlesize 8 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 20 5 } -cleanup { - deleteWindows + deleteWindows } -result {0 handle} test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 + -handlesize 8 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 20 0 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] \ - [frame .f3 -bg green -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] \ + [frame .f3 -bg green -width 20 -height 20] .p identify 48 0 } -cleanup { - deleteWindows + deleteWindows } -result {1 sash} test panedwindow-26.13 {identify subcommand errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 .p identify } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {wrong # args: should be ".p identify x y"} test panedwindow-26.14 {identify subcommand errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p identify foo bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "foo"} test panedwindow-26.15 {identify subcommand errors} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p .p identify 0 bar } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {expected integer but got "bar"} test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 0 } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 20 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 22 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 24 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 26 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify -1 26 } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 100 26 } -cleanup { - deleteWindows + deleteWindows } -result {} test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 -orient vertical + -handlesize 6 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 4 22 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 -orient vertical + -handlesize 6 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 5 22 } -cleanup { - deleteWindows + deleteWindows } -result {0 handle} test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 -orient vertical + -handlesize 8 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 5 20 } -cleanup { - deleteWindows + deleteWindows } -result {0 handle} test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 -orient vertical + -handlesize 8 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 20 } -cleanup { - deleteWindows + deleteWindows } -result {0 sash} test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] \ - [frame .f3 -bg green -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] \ + [frame .f3 -bg green -width 20 -height 20] .p identify 0 48 } -cleanup { - deleteWindows + deleteWindows } -result {1 sash} test panedwindow-27.1 {destroy the window cleanly on error [Bug #616589]} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bogusopt bogus } -cleanup { - deleteWindows + deleteWindows } -returnCodes error -result {unknown option "-bogusopt"} test panedwindow-27.2 {destroy the window cleanly on rename [Bug #616589]} -setup { - deleteWindows + deleteWindows } -body { destroy .p panedwindow .p rename .p {} winfo exists .p } -cleanup { - deleteWindows + deleteWindows } -result {0} test panedwindow-28.1 {resizing width} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -bd 5 frame .f1 -width 100 -height 50 -bg blue @@ -5492,7 +5492,7 @@ test panedwindow-28.1 {resizing width} -setup { } -result {100 110} test panedwindow-28.2 {resizing height} -setup { - deleteWindows + deleteWindows } -body { panedwindow .p -orient vertical -bd 5 frame .f1 -width 50 -height 100 -bg blue @@ -5518,13 +5518,13 @@ test panedwindow-28.2 {resizing height} -setup { test panedwindow-29.1 {display on depths other than the default one} -constraints { pseudocolor8 haveTruecolor24 } -setup { - deleteWindows + deleteWindows } -body { - toplevel .t -visual {truecolor 24} - pack [panedwindow .t.p] - .t.p add [frame .t.p.f1] [frame .t.p.f2] - update - # If we got here, we didn't crash and that's good + toplevel .t -visual {truecolor 24} + pack [panedwindow .t.p] + .t.p add [frame .t.p.f1] [frame .t.p.f2] + update + # If we got here, we didn't crash and that's good } -cleanup { deleteWindows } -result {} @@ -5533,16 +5533,16 @@ test panedwindow-29.2 {display on depths other than the default one} -constraint } -setup { deleteWindows } -body { - toplevel .t -visual {pseudocolor 8} - pack [frame .t.f -visual {truecolor 24}] - pack [panedwindow .t.f.p] - .t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5] - update - .t.f.p proxy place 1 1 - update - .t.f.p proxy forget - update - # If we got here, we didn't crash and that's good + toplevel .t -visual {pseudocolor 8} + pack [frame .t.f -visual {truecolor 24}] + pack [panedwindow .t.f.p] + .t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5] + update + .t.f.p proxy place 1 1 + update + .t.f.p proxy forget + update + # If we got here, we didn't crash and that's good } -cleanup { deleteWindows } -result {} -- cgit v0.12 From aaa940959560ec5e844c3ffafd4f91bb70dfc455 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 6 Apr 2022 21:01:18 +0000 Subject: Factorize proc update* --- tests/constraints.tcl | 13 +- tests/entry.test | 52 ++-- tests/spinbox.test | 52 ++-- tests/textDisp.test | 806 +++++++++++++++++++++++++------------------------- 4 files changed, 452 insertions(+), 471 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 65609d6..aad3287 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -137,7 +137,6 @@ namespace eval tk { destroy .focus } - namespace export imageInit imageFinish imageCleanup imageNames variable ImageNames proc imageInit {} { @@ -233,6 +232,18 @@ namespace eval tk { } namespace export controlPointerWarpTiming + namespace export updateWidgets + # Platform specific procedure for updating the display. + if {[tk windowingsystem] == "aqua"} { + proc updateWidgets {} { + update idletasks + } + } else { + proc updateWidgets {} { + update + } + } + } } diff --git a/tests/entry.test b/tests/entry.test index 942a5c5..fcc9427 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -15,18 +15,6 @@ testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match L testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}] testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] -# Platform specific procedure for updating the entry widget. - -if {[tk windowingsystem] == "aqua"} { - proc updateEntry {} { - update idletasks - } -} else { - proc updateEntry {} { - update - } -} - # For xscrollcommand set scrollInfo {} proc scroll args { @@ -1688,10 +1676,10 @@ test entry-5.7 {ConfigureEntry procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - updateEntry + updateWidgets set scrollInfo wrong .e configure -width 5 - updateEntry + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -1933,11 +1921,11 @@ test entry-7.1 {InsertChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 abcde .e insert 2 XXX - updateEntry + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -1950,11 +1938,11 @@ test entry-7.2 {InsertChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 abcde .e insert 500 XXX - updateEntry + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2084,11 +2072,11 @@ test entry-8.1 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 abcde .e delete 2 4 - updateEntry + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2100,11 +2088,11 @@ test entry-8.2 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 abcde .e delete -1 2 - updateEntry + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2116,11 +2104,11 @@ test entry-8.3 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 abcde .e delete 3 1000 - updateEntry + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2954,11 +2942,11 @@ test entry-16.4 {EntryVisibleRange procedure} -body { test entry-17.1 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateEntry + updateWidgets set scrollInfo wrong .e delete 0 end .e insert 0 123 - updateEntry + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2966,11 +2954,11 @@ test entry-17.1 {EntryUpdateScrollbar procedure} -body { test entry-17.2 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 0123456789abcdef .e xview 3 - updateEntry + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2978,11 +2966,11 @@ test entry-17.2 {EntryUpdateScrollbar procedure} -body { test entry-17.3 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateEntry + updateWidgets set scrollInfo wrong .e insert 0 abcdefghijklmnopqrs .e xview 6 - updateEntry + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2995,10 +2983,10 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup { } -body { entry .e -width 5 pack .e - updateEntry + updateWidgets set scrollInfo wrong .e configure -xscrollcommand thisisnotacommand - updateEntry + updateWidgets list $x $errorInfo } -cleanup { destroy .e diff --git a/tests/spinbox.test b/tests/spinbox.test index 530c4e1..98c88cd 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -14,18 +14,6 @@ tcltest::loadTestedCommands testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}] -# Platform specific procedure for updating the spinbox widget. - -if {[tk windowingsystem] == "aqua"} { - proc updateSpin {} { - update idletasks - } -} else { - proc updateSpin {} { - update - } -} - # For xscrollcommand set scrollInfo {} proc scroll args { @@ -2029,10 +2017,10 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - updateSpin + updateWidgets set scrollInfo wrong .e configure -width 5 - updateSpin + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2220,10 +2208,10 @@ test spinbox-7.1 {InsertChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateSpin + updateWidgets set scrollInfo wrong .e insert 2 XXX - updateSpin + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2237,10 +2225,10 @@ test spinbox-7.2 {InsertChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateSpin + updateWidgets set scrollInfo wrong .e insert 500 XXX - updateSpin + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2371,10 +2359,10 @@ test spinbox-8.1 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateSpin + updateWidgets set scrollInfo wrong .e delete 2 4 - updateSpin + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2387,10 +2375,10 @@ test spinbox-8.2 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateSpin + updateWidgets set scrollInfo wrong .e delete -1 2 - updateSpin + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2403,10 +2391,10 @@ test spinbox-8.3 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateSpin + updateWidgets set scrollInfo wrong .e delete 3 1000 - updateSpin + updateWidgets list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -3189,11 +3177,11 @@ test spinbox-16.2 {SpinboxVisibleRange procedure} -body { test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateSpin + updateWidgets set scrollInfo wrong .e delete 0 end .e insert 0 123 - updateSpin + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -3202,10 +3190,10 @@ test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 0123456789abcdef - updateSpin + updateWidgets set scrollInfo wrong .e xview 3 - updateSpin + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -3213,11 +3201,11 @@ test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body { test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateSpin + updateWidgets set scrollInfo wrong .e insert 0 abcdefghijklmnopqrs .e xview - updateSpin + updateWidgets format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -3230,10 +3218,10 @@ test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup { } -body { spinbox .e -width 5 pack .e - updateSpin + updateWidgets set scrollInfo wrong .e configure -xscrollcommand thisisnotacommand - updateSpin + updateWidgets list $x $errorInfo } -cleanup { destroy .e diff --git a/tests/textDisp.test b/tests/textDisp.test index 9c4e0e9..f072f25 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -14,21 +14,15 @@ namespace import -force tcltest::test testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] -# Platform specific procedure for updating the text widget. +# Platform specific procedure for updating the text widget twice, with an in-between delay if {[tk windowingsystem] == "aqua"} { - proc updateText {} { - update idletasks - } proc delay {} { update idletasks after 100 update idletasks } } else { - proc updateText {} { - update - } proc delay {} { update after 100 @@ -102,7 +96,7 @@ wm withdraw . wm minsize . 1 1 wm positionfrom . user wm deiconify . -updateText +updateWidgets # Some window managers (like olwm under SunOS 4.1.3) misbehave in a way # that tends to march windows off the top and left of the screen. If @@ -183,7 +177,7 @@ test textDisp-0.3 {double tag elide transition} { .txt tag configure SYSTEM -elide 0 .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {TRAFFIC SYSTEM} - updateText + updateWidgets destroy .txt } {} @@ -196,7 +190,7 @@ test textDisp-0.4 {double tag elide transition} { .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {SYSTEM TRAFFIC} # Crash was here. - updateText + updateWidgets destroy .txt } {} @@ -210,7 +204,7 @@ test textDisp-0.5 {double tag elide transition} { .txt insert end "\n" {SYSTEM TRAFFIC} .txt insert end "\n" WELCOME # Crash was here. - updateText + updateWidgets destroy .txt } {} @@ -241,7 +235,7 @@ test textDisp-1.2 {GetStyle procedure, wrapmode} {textfonts} { .t tag configure x -wrap word .t tag configure y -wrap none .t tag raise y - updateText + updateWidgets set result [list [.t bbox 2.20]] .t tag add x 2.0 2.1 lappend result [.t bbox 2.20] @@ -300,7 +294,7 @@ foreach m [.t mark names] { scan [wm geom .] %dx%d width height test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {textfonts} { wm geom . [expr {$width+1}]x$height - updateText + updateWidgets .t configure -wrap char .t delete 1.0 end .t insert 1.0 "This isxx some sample text for testing." @@ -308,7 +302,7 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {textfonts} { list [.t bbox 1.19] [.t bbox 1.20] } [list [list 138 5 8 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]] wm geom . {} -updateText +updateWidgets test textDisp-2.9 {LayoutDLine, marks and tags} {textfonts} { .t configure -wrap word .t delete 1.0 end @@ -560,33 +554,33 @@ test textDisp-3.1 {different character sizes} {textfonts} { test textDisp-4.1 {UpdateDisplayInfo, basic} {textfonts} { .t delete 1.0 end .t insert end "Line 1\nLine 2\nLine 3\n" - updateText + updateWidgets .t delete 2.0 2.end - updateText + updateWidgets set res $tk_textRelayout .t insert 2.0 "New Line 2" - updateText + updateWidgets lappend res [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout } [list 2.0 [list 5 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] 2.0] test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {textfonts} { .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateText + updateWidgets .t mark set x 2.21 .t delete 2.2 - updateText + updateWidgets set res $tk_textRelayout .t insert 2.0 X - updateText + updateWidgets lappend res [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list 2.0 2.20 [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 12 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] {2.0 2.20}] test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {textfonts} { .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateText + updateWidgets .t mark set x 2.21 .t delete 2.2 - updateText + updateWidgets list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] {2.0 2.20}] .t mark unset x @@ -594,7 +588,7 @@ test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {textfonts} { .t configure -wrap none .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateText + updateWidgets list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout } [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] {1.0 2.0 3.0}] test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} { @@ -602,11 +596,11 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} { wm overrideredirect . 1 } wm geom . 103x$height - updateText + updateWidgets .t configure -wrap none .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateText + updateWidgets list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout } [list [list 5 [expr {$fixedDiff + 18}] 1 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 1 $fixedHeight] {1.0 2.0 3.0}] if {[tk windowingsystem] == "win32"} { @@ -626,20 +620,20 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} { frame .f2 -width 20 -height 100 pack .f2 -before .f wm geom . 103x103 - updateText + updateWidgets .t configure -wrap none -borderwidth 2 .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateText + updateWidgets set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout] wm overrideredirect . 0 - updateText + updateWidgets set x } [list [list 5 5 1 1] {} 1.0] catch {destroy .f2} .t configure -borderwidth 0 -wrap char wm geom . {} -updateText +updateWidgets set bw [.t cget -borderwidth] set px [.t cget -padx] set py [.t cget -pady] @@ -658,28 +652,28 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 1.0 - updateText + updateWidgets .t yview 16.0 - updateText + updateWidgets set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] wm overrideredirect . 0 - updateText + updateWidgets set x } {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}} test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} failsOnXQuarz { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 16.0 - updateText + updateWidgets .t delete 5.0 14.0 - updateText + updateWidgets set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] } {1.0 {5.0 4.0 3.0 2.0 1.0} {1.0 2.0 3.0 4.0 5.0 eof}} test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfonts} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 16.0 - updateText + updateWidgets .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] } [list [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 2 * $fixedHeight}] $fixedWidth $fixedHeight] [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 7 * $fixedHeight}] $fixedWidth $fixedHeight]] @@ -687,18 +681,18 @@ test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview end - updateText + updateWidgets .t delete 13.0 end - updateText + updateWidgets list [.t index @0,0] $tk_textRelayout $tk_textRedraw } {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}} test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview end - updateText + updateWidgets .t delete 14.0 end - updateText + updateWidgets list [.t index @0,0] $tk_textRelayout $tk_textRedraw } {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}} test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { @@ -707,11 +701,11 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { button .b -text "Test" -bd 2 -highlightthickness 2 .t window create 3.end -window .b .t yview moveto 1 - updateText + updateWidgets .t yview moveto 0 - updateText + updateWidgets .t yview moveto 1 - updateText + updateWidgets winfo ismapped .b } {0} .t configure -wrap word @@ -724,33 +718,33 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag add x 1.0 end .t yview 1.0 - updateText + updateWidgets .t yview scroll 3 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}} test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} failsOnXQuarz { .t tag remove x 1.0 end .t yview 1.0 - updateText + updateWidgets .t yview scroll 3 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {11.0 12.0 13.0}} test textDisp-4.15 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag add x 1.0 end .t yview 4.0 - updateText + updateWidgets .t yview scroll -2 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0 4.0 11.0}} test textDisp-4.16 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end .t yview 4.0 - updateText + updateWidgets .t yview scroll -2 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -758,9 +752,9 @@ test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .t delete 1.0 end .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" - updateText + updateWidgets .t xview scroll 3 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw [.t bbox 2.0] [.t bbox 2.5] \ [.t bbox 2.23] } [list {} {1.0 2.0 3.0 4.0} {} [list 17 [expr {$fixedDiff + 16}] 7 $fixedHeight] {}] @@ -769,9 +763,9 @@ test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .t delete 1.0 end .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" - updateText + updateWidgets .t xview scroll 100 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list {} {1.0 2.0 3.0 4.0} [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -779,10 +773,10 @@ test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .t delete 1.0 end .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" - updateText + updateWidgets .t xview moveto 0 .t xview scroll -10 units - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw [.t bbox 2.5] } [list {} {1.0 2.0 3.0 4.0} [list 38 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -792,9 +786,9 @@ test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .t insert end "\nLine 3\nLine 4" .t xview moveto 0.0 .t xview scroll 100 units - updateText + updateWidgets .t delete 2.30 2.44 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list 2.0 {1.0 2.0 3.0 4.0} [list 108 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -803,9 +797,9 @@ test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" .t xview moveto .9 - updateText + updateWidgets .t xview moveto .6 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {}} test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {textfonts} { @@ -814,7 +808,7 @@ test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" .t xview scroll 25 units - updateText + updateWidgets .t configure -wrap word list [.t bbox 2.0] [.t bbox 2.16] } [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 10 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]] @@ -824,7 +818,7 @@ test textDisp-4.23 {UpdateDisplayInfo, no horizontal scrolling except for -wrap .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" .t xview scroll 25 units - updateText + updateWidgets .t configure -wrap char list [.t bbox 2.0] [.t bbox 2.16] } [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 115 [expr {$fixedDiff + 16}] 7 $fixedHeight]] @@ -842,7 +836,7 @@ test textDisp-5.1 {DisplayDLine, handling of spacing} {textfonts} { .t window create 1.7 -window .t.f2 -align center .t window create 2.1 -window .t.f3 -align bottom .t window create 2.10 -window .t.f4 -align baseline - updateText + updateWidgets list [winfo geometry .t.f1] [winfo geometry .t.f2] \ [winfo geometry .t.f3] [winfo geometry .t.f4] } [list 10x4+24+11 10x4+55+[expr {$fixedDiff/2 + 15}] 10x4+10+[expr {2*$fixedDiff + 43}] 10x4+76+[expr {2*$fixedDiff + 40}]] @@ -857,7 +851,7 @@ test textDisp-5.2 {DisplayDLine, line resizes during display} { frame .t.f -width 20 -height 20 -bd 2 -relief raised bind .t.f {.t.f configure -width 30 -height 30} .t window create insert -window .t.f - updateText + updateWidgets list [winfo width .t.f] [winfo height .t.f] } [list 30 30] @@ -868,9 +862,9 @@ test textDisp-6.1 {scrolling in DisplayText, scroll up} failsOnXQuarz { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 2.0 3.0 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 10.0} {2.0 10.0}} test textDisp-6.2 {scrolling in DisplayText, scroll down} { @@ -879,9 +873,9 @@ test textDisp-6.2 {scrolling in DisplayText, scroll down} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t insert 2.0 "New Line 2\n" - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { @@ -891,10 +885,10 @@ test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t insert 2.end "is so long that it wraps" .t insert 4.end "is so long that it wraps" - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 4.0 4.20} {2.0 2.20 4.0 4.20}} test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} { @@ -904,10 +898,10 @@ test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t insert 2.end "is so long that it wraps around, not once but three times" .t insert 4.end "is so long that it wraps" - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}} test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {nonPortable} { @@ -919,9 +913,9 @@ test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {nonPortabl foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 1.6 1.end - updateText + updateWidgets destroy .f2 list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}} @@ -936,31 +930,31 @@ test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {unix n foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 1.6 1.end destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {borders 1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}} .t configure -bd 0 test textDisp-6.7 {DisplayText, vertical scrollbar updates} { .t configure -wrap char .t delete 1.0 end - updateText + updateWidgets .t count -update -ypixels 1.0 end - updateText + updateWidgets set scrollInfo } {0.0 1.0} test textDisp-6.8 {DisplayText, vertical scrollbar updates} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1" - updateText + updateWidgets set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - updateText + updateWidgets .t count -update -ypixels 1.0 end ; update set scrollInfo } [list 0.0 [expr {10.0/13}]] @@ -968,12 +962,12 @@ test textDisp-6.8 {DisplayText, vertical scrollbar updates} { test textDisp-6.9 {DisplayText, horizontal scrollbar updates} { .t configure -wrap none .t delete 1.0 end - updateText + updateWidgets set scrollInfo unchanged .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateText + updateWidgets set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua} { @@ -992,9 +986,9 @@ test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua .t insert end "\nLine 8\n" .t window create end -create { button %W.button_three -text "Button 3"} - updateText + updateWidgets .t delete 2.0 3.0 - updateText + updateWidgets list $tk_textEmbWinDisplay } {{4.0 6.0}} @@ -1012,61 +1006,61 @@ foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { test textDisp-7.1 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.2 -relwidth 0.6 -rely 0.22 -relheight 0.55 - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {1.40 2.0 3.0 4.0 5.0 6.0}} test textDisp-7.2 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0 -relwidth 0.5 -rely 0 -relheight 0.5 - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20 1.40 2.0 3.0}} test textDisp-7.3 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.5 -relwidth 0.5 -rely 0.5 -relheight 0.5 - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 8.0}} test textDisp-7.4 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 0 -relheight 0.2 \ -bordermode ignore - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20}} test textDisp-7.5 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 1.0 -relheight 0.2 \ -anchor s -bordermode ignore - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 7.0 8.0}} test textDisp-7.6 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \ -anchor w -bordermode ignore - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.7 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 1.0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \ -anchor e -bordermode ignore - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} { @@ -1075,9 +1069,9 @@ test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.0 -relwidth 0.4 -rely 0.35 -relheight 0.4 \ -anchor nw -bordermode ignore - updateText + updateWidgets destroy .f2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 eof}} .t configure -bd 0 @@ -1089,9 +1083,9 @@ test textDisp-8.1 {TkTextChanged: redisplay whole lines} {textfonts} { foreach i {3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 2.36 2.38 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw [.t bbox 2.32] } [list {2.0 2.18 2.38} {2.0 2.18 2.38} [list 101 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]] .t configure -wrap char @@ -1101,9 +1095,9 @@ test textDisp-8.2 {TkTextChanged, redisplay whole lines} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t insert 1.2 xx - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.3 {TkTextChanged} { @@ -1112,9 +1106,9 @@ test textDisp-8.3 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t insert 2.0 xx - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.4 {TkTextChanged} { @@ -1123,9 +1117,9 @@ test textDisp-8.4 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 1.5 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.5 {TkTextChanged} { @@ -1134,9 +1128,9 @@ test textDisp-8.5 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 1.40 1.44 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.6 {TkTextChanged} { @@ -1145,9 +1139,9 @@ test textDisp-8.6 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 1.41 1.44 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.7 {TkTextChanged} failsOnXQuarz { @@ -1156,9 +1150,9 @@ test textDisp-8.7 {TkTextChanged} failsOnXQuarz { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 1.2 1.end - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 9.0 10.0}} test textDisp-8.8 {TkTextChanged} { @@ -1167,9 +1161,9 @@ test textDisp-8.8 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 2.2 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.9 {TkTextChanged} failsOnXQuarz { @@ -1178,9 +1172,9 @@ test textDisp-8.9 {TkTextChanged} failsOnXQuarz { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateText + updateWidgets .t delete 2.0 3.0 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} test textDisp-8.10 {TkTextChanged} failsOnUbuntu { @@ -1188,23 +1182,23 @@ test textDisp-8.10 {TkTextChanged} failsOnUbuntu { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 2.19 - updateText + updateWidgets .t delete 2.19 - updateText + updateWidgets set tk_textRedraw } {2.0 2.20 eof} test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-screen} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n" .t configure -yscrollcommand scroll - updateText + updateWidgets set scrollInfo "" .t insert end "a\nb\nc\n" # We need to wait for our asychronous callbacks to update the # scrollbar - updateText + updateWidgets .t count -update -ypixels 1.0 end - updateText + updateWidgets .t configure -yscrollcommand "" set scrollInfo } {0.0 0.625} @@ -1217,27 +1211,27 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an .t tag add hidden 5.0 8.0 .t tag configure hidden -elide true .t mark set insert 9.0 - updateText + updateWidgets .t mark set insert 8.0 ; # up one line - updateText + updateWidgets set res [list $tk_textRedraw] .t mark set insert 12.2 ; # in the visible text - updateText + updateWidgets lappend res $tk_textRedraw .t mark set insert 6.5 ; # in the hidden text - updateText + updateWidgets lappend res $tk_textRedraw .t mark set insert 3.5 ; # in the visible text again - updateText + updateWidgets lappend res $tk_textRedraw .t mark set insert 3.8 ; # within the same line - updateText + updateWidgets lappend res $tk_textRedraw } {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {3.0 4.0}} test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { .t delete 1.0 end .t insert 1.0 \nLine2\nLine3\n - updateText + updateWidgets .t insert 3.0 "" .t delete 1.0 2.0 update idletasks @@ -1247,62 +1241,62 @@ test textDisp-9.1 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateText + updateWidgets .t tag add big 2.2 2.4 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.18} {2.0 2.18}} test textDisp-9.2 {TkTextRedrawTag} {textfonts} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateText + updateWidgets .t tag add big 1.2 2.4 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.17} {1.0 2.0 2.17}} test textDisp-9.3 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateText + updateWidgets .t tag add big 2.2 2.4 - updateText + updateWidgets .t tag remove big 1.0 end - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.4 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateText + updateWidgets .t tag add big 2.2 2.20 - updateText + updateWidgets .t tag remove big 1.0 end - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.5 {TkTextRedrawTag} {failsOnUbuntu failsOnXQuarz} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateText + updateWidgets .t tag add big 2.2 2.end - updateText + updateWidgets .t tag remove big 1.0 end - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.6 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap" - updateText + updateWidgets .t tag add big 2.2 3.5 - updateText + updateWidgets .t tag remove big 1.0 end - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}} test textDisp-9.7 {TkTextRedrawTag} failsOnUbuntu { @@ -1310,9 +1304,9 @@ test textDisp-9.7 {TkTextRedrawTag} failsOnUbuntu { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 2.19 - updateText + updateWidgets .t tag remove big 2.19 - updateText + updateWidgets set tk_textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} {textfonts} { @@ -1320,9 +1314,9 @@ test textDisp-9.8 {TkTextRedrawTag} {textfonts} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateText + updateWidgets .t tag add big 2.0 2.5 - updateText + updateWidgets set tk_textRedraw } {2.0 2.17} test textDisp-9.9 {TkTextRedrawTag} {textfonts} { @@ -1330,9 +1324,9 @@ test textDisp-9.9 {TkTextRedrawTag} {textfonts} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateText + updateWidgets .t tag add big 1.5 2.5 - updateText + updateWidgets set tk_textRedraw } {2.0 2.17} test textDisp-9.10 {TkTextRedrawTag} { @@ -1340,10 +1334,10 @@ test textDisp-9.10 {TkTextRedrawTag} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateText + updateWidgets set tk_textRedraw none .t tag add big 1.3 1.5 - updateText + updateWidgets set tk_textRedraw } none test textDisp-9.11 {TkTextRedrawTag} { @@ -1351,9 +1345,9 @@ test textDisp-9.11 {TkTextRedrawTag} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateText + updateWidgets .t tag add big 1.0 2.0 - updateText + updateWidgets set tk_textRedraw } {} test textDisp-9.12 {TkTextRedrawTag} { @@ -1364,9 +1358,9 @@ test textDisp-9.12 {TkTextRedrawTag} { } .t tag configure hidden -elide true .t tag add hidden 2.6 3.6 - updateText + updateWidgets .t tag add hidden 3.11 4.6 - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {2.0 {2.0 eof}} test textDisp-9.13 {TkTextRedrawTag} { @@ -1379,9 +1373,9 @@ test textDisp-9.13 {TkTextRedrawTag} { .t tag add hidden 6.8 7.17 .t tag configure hidden -background red .t tag configure hidden -elide true - updateText + updateWidgets .t tag configure hidden -elide false - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{2.0 6.0 7.0} {2.0 6.0 7.0}} test textDisp-9.14 {TkTextRedrawTag} { @@ -1391,7 +1385,7 @@ test textDisp-9.14 {TkTextRedrawTag} { } .tnocrash tag configure mytag1 -relief raised .tnocrash tag configure mytag2 -relief solid - updateText + updateWidgets proc doit {} { .tnocrash tag add mytag1 4.0 5.0 .tnocrash tag add mytag2 4.0 5.0 @@ -1413,9 +1407,9 @@ test textDisp-10.1 {TkTextRelayoutWindow} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" - updateText + updateWidgets .t configure -bg black - updateText + updateWidgets list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}} .t configure -bg [lindex [.t configure -bg] 3] @@ -1429,7 +1423,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} { .top.t see insert tkwait visibility .top.t place .top.t -width 150 -height 100 - updateText + updateWidgets .top.t index @0,0 } {1.0} catch {destroy .top} @@ -1439,96 +1433,96 @@ catch {destroy .top} for {set i 2} {$i <= 200} {incr i} { .t insert end "\nLine $i" } -updateText +updateWidgets test textDisp-11.1 {TkTextSetYView} { .t yview 30.0 - updateText + updateWidgets .t index @0,0 } {30.0} test textDisp-11.2 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 - updateText + updateWidgets .t yview 32.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.3 {TkTextSetYView} { .t yview 30.0 - updateText + updateWidgets .t yview 28.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.4 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 - updateText + updateWidgets .t yview 31.4 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {31.0 40.0} test textDisp-11.5 {TkTextSetYView} { .t yview 30.0 - updateText + updateWidgets set tk_textRedraw {} .t yview -pickplace 31.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {30.0 {}} test textDisp-11.6 {TkTextSetYView} { .t yview 30.0 - updateText + updateWidgets set tk_textRedraw {} .t yview -pickplace 28.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.7 {TkTextSetYView} { .t yview 30.0 - updateText + updateWidgets set tk_textRedraw {} .t yview -pickplace 26.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}} test textDisp-11.8 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 - updateText + updateWidgets set tk_textRedraw {} .t yview -pickplace 41.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.9 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 - updateText + updateWidgets set tk_textRedraw {} .t yview -pickplace 43.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {38.0 {40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0}} test textDisp-11.10 {TkTextSetYView} { .t yview 30.0 - updateText + updateWidgets set tk_textRedraw {} .t yview 10000.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0}} test textDisp-11.11 {TkTextSetYView} { .t yview 195.0 - updateText + updateWidgets set tk_textRedraw {} .t yview 197.0 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}} test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} failsOnXQuarz { .t insert 10.0 "Long line with enough text to wrap\n" .t yview 1.0 - updateText + updateWidgets set tk_textRedraw {} .t see 10.30 - updateText + updateWidgets list [.t index @0,0] $tk_textRedraw } {2.0 10.20} .t delete 10.0 11.0 @@ -1542,15 +1536,15 @@ test textDisp-11.13 {TkTestSetYView, partially visible last line} { for {set i 2} {$i <= 100} {incr i} { .top.t insert end "\nLine $i" } - updateText + updateWidgets scan [wm geometry .top] "%dx%d" w2 h2 wm geometry .top ${w2}x[expr {$h2-2}] - updateText + updateWidgets .top.t yview 1.0 - updateText + updateWidgets set tk_textRedraw {} .top.t see 5.0 - updateText + updateWidgets # Note, with smooth scrolling, the results of this test # have changed, and the old '2.0 {5.0 6.0}' is quite wrong. list [.top.t index @0,0] $tk_textRedraw @@ -1564,29 +1558,29 @@ pack .top.t for {set i 2} {$i <= 20} {incr i} { .top.t insert end "\nLine $i" } -updateText +updateWidgets test textDisp-11.14 {TkTextSetYView, only a few lines visible} { .top.t yview 5.0 - updateText + updateWidgets .top.t see 10.0 .top.t index @0,0 } {8.0} test textDisp-11.15 {TkTextSetYView, only a few lines visible} { .top.t yview 5.0 - updateText + updateWidgets .top.t see 11.0 .top.t index @0,0 # The index 9.0 should be just visible by a couple of pixels } {9.0} test textDisp-11.16 {TkTextSetYView, only a few lines visible} { .top.t yview 8.0 - updateText + updateWidgets .top.t see 5.0 .top.t index @0,0 } {5.0} test textDisp-11.17 {TkTextSetYView, only a few lines visible} { .top.t yview 8.0 - updateText + updateWidgets .top.t see 4.0 .top.t index @0,0 # The index 2.0 should be just visible by a couple of pixels @@ -1601,7 +1595,7 @@ test textDisp-11.18 {TkTextSetYView, see in elided lines} { .top.t tag add hidden 4.10 "4.10 lineend" .top.t tag add hidden 5.15 10.3 .top.t tag configure hidden -elide true - updateText + updateWidgets .top.t see "8.0 lineend" # The index "8.0 lineend" is on screen despite elided -> no scroll .top.t index @0,0 @@ -1621,19 +1615,19 @@ test textDisp-11.19 {TkTextSetYView, see in elided lines} { # Indices 21.0, 17.0 and 15.0 are all on the same display line # therefore index @0,0 shall be the same for all of them .top.t see end - updateText + updateWidgets .top.t see 21.0 - updateText + updateWidgets set ind1 [.top.t index @0,0] .top.t see end - updateText + updateWidgets .top.t see 17.0 - updateText + updateWidgets set ind2 [.top.t index @0,0] .top.t see end - updateText + updateWidgets .top.t see 15.0 - updateText + updateWidgets set ind3 [.top.t index @0,0] list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}] } {1 1} @@ -1656,7 +1650,7 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} } set lineheight [font metrics [.top.t cget -font] -linespace] wm geometry .top 200x[expr {$lineheight / 2}] - updateText + updateWidgets .top.t see 1.0 .top.t index @0,[expr {$lineheight - 2}] } {1.0} @@ -1668,9 +1662,9 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} { pack [.top.t peer create .top.p] -side left pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y .top.p configure -startline 5 -endline 35 -yscrollcommand {.top.sb set} - updateText + updateWidgets .top.p yview moveto 0 - updateText + updateWidgets set res [.top.p get @0,0 "@0,0 lineend"] destroy .top.p set res @@ -1681,38 +1675,38 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} { .t insert 50.0 "This is a long line, one that will wrap around twice.\n" test textDisp-12.1 {MeasureUp} { .t yview 100.0 - updateText + updateWidgets .t yview -pickplace 52.0 - updateText + updateWidgets .t index @0,0 } {49.0} test textDisp-12.2 {MeasureUp} { .t yview 100.0 - updateText + updateWidgets .t yview -pickplace 53.0 - updateText + updateWidgets .t index @0,0 } {50.0} test textDisp-12.3 {MeasureUp} { .t yview 100.0 - updateText + updateWidgets .t yview -pickplace 50.10 - updateText + updateWidgets .t index @0,0 } {45.0} .t configure -wrap none test textDisp-12.4 {MeasureUp} { .t yview 100.0 - updateText + updateWidgets .t yview -pickplace 53.0 - updateText + updateWidgets .t index @0,0 } {48.0} test textDisp-12.5 {MeasureUp} { .t yview 100.0 - updateText + updateWidgets .t yview -pickplace 50.10 - updateText + updateWidgets .t index @0,0 } {45.0} @@ -1735,7 +1729,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} { test textDisp-13.4 {TkTextSeeCmd procedure} { .t xview moveto 0 .t yview moveto 0 - updateText + updateWidgets .t see 4.2 .t index @0,0 } {1.0} @@ -1743,7 +1737,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - updateText + updateWidgets .t see 12.1 .t index @0,0 } {3.0} @@ -1751,7 +1745,7 @@ test textDisp-13.6 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - updateText + updateWidgets .t see 30.50 set x [.t index @0,0] .t configure -wrap none @@ -1762,7 +1756,7 @@ test textDisp-13.7 {TkTextSeeCmd procedure} {textfonts} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.40 - updateText + updateWidgets .t see 30.50 .t yview 25.0 .t see 30.50 @@ -1779,7 +1773,7 @@ test textDisp-13.8 {TkTextSeeCmd procedure} {textfonts} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - updateText + updateWidgets .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1795,7 +1789,7 @@ test textDisp-13.9 {TkTextSeeCmd procedure} {textfonts} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - updateText + updateWidgets .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1827,13 +1821,13 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { } wm geometry .top2 300x200+0+0 - updateText + updateWidgets .top2.t2 see "1.0 lineend" - updateText + updateWidgets set ref [.top2.t2 index @0,0] .top2.t2 insert "1.0 lineend" ç .top2.t2 see "1.0 lineend" - updateText + updateWidgets set new [.top2.t2 index @0,0] set res [.top2.t2 compare $ref == $new] destroy .top2 @@ -1844,7 +1838,7 @@ wm geom . {} .t configure -wrap none test textDisp-14.1 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateText + updateWidgets .t insert end xxxxxxxxx\n .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" @@ -1854,7 +1848,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} { .t configure -wrap char test textDisp-14.2 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateText + updateWidgets .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -1863,7 +1857,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} { .t configure -wrap none test textDisp-14.3 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateText + updateWidgets .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -1956,43 +1950,43 @@ for {set i 1} {$i < 99} {incr i} { .t insert 50.0 "This is a long line, one that will wrap around twice.\n" test textDisp-15.1 {ScrollByLines procedure, scrolling backwards} { .t yview 45.0 - updateText + updateWidgets .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - updateText + updateWidgets .t yview scroll -2 units .t index @0,0 } {50.20} test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - updateText + updateWidgets .t yview scroll -4 units .t index @0,0 } {49.0} test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} { .t yview 50.20 - updateText + updateWidgets .t yview scroll -2 units .t index @0,0 } {49.0} test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} { .t yview 50.40 - updateText + updateWidgets .t yview scroll -2 units .t index @0,0 } {50.0} test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} { .t yview 3.2 - updateText + updateWidgets .t yview scroll -5 units .t index @0,0 } {1.0} test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} { .t yview 48.0 - updateText + updateWidgets .t yview scroll 4 units .t index @0,0 } {50.40} @@ -2018,7 +2012,7 @@ test textDisp-15.8 {Scrolling near end of window} { for {set i 1} {$i < $textheight} {incr i} { .tf.f.t insert end "\nLine $i" } - updateText + updateWidgets set refind [.tf.f.t index @0,[winfo height .tf.f.t]] # Should scroll and should not crash! .tf.f.t yview scroll 1 unit @@ -2038,7 +2032,7 @@ for {set i 2} {$i <= 200} {incr i} { .t tag add big 100.0 105.0 .t insert 151.end { has a lot of extra text, so that it wraps around on the screen several times over.} .t insert 153.end { also has enoug extra text to wrap.} -updateText +updateWidgets .t count -update -ypixels 1.0 end test textDisp-16.1 {TkTextYviewCmd procedure} { .t yview 21.0 @@ -2060,7 +2054,7 @@ test textDisp-16.5 {TkTextYviewCmd procedure} { } {1 {bad option "-bogus": must be moveto or scroll}} test textDisp-16.6 {TkTextYviewCmd procedure, integer position} { .t yview 100.0 - updateText + updateWidgets .t yview 98 .t index @0,0 } {99.0} @@ -2115,7 +2109,7 @@ test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} {textfonts} { text .top1.t -height 3 -width 4 -wrap none -setgrid 1 -padx 6 \ -spacing3 6 pack .top1.t - updateText + updateWidgets .top1.t insert end "1\n2\n3\n4\n5\n6" .top1.t yview moveto 0.3333 set result [.top1.t yview] @@ -2136,7 +2130,7 @@ test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} { } {1 {expected integer but got "badInt"}} test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 - updateText + updateWidgets .t yview scroll -1 pages .t index @0,0 } {42.0} @@ -2145,42 +2139,42 @@ test textDisp-16.22.1 {TkTextYviewCmd procedure, "scroll" option, back pages} { } {1 {ambiguous argument "p": must be units, pages, or pixels}} test textDisp-16.23 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 - updateText + updateWidgets .t yview scroll -3 pa .t index @0,0 } {26.0} test textDisp-16.24 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 5.0 - updateText + updateWidgets .t yview scroll -3 pa .t index @0,0 } {1.0} test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t configure -height 1 - updateText + updateWidgets .t yview 50.0 - updateText + updateWidgets .t yview scroll -1 pages set x [.t index @0,0] .t configure -height 10 - updateText + updateWidgets set x } {49.0} test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 50.0 - updateText + updateWidgets .t yview scroll 1 pages .t index @0,0 } {58.0} test textDisp-16.27 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 50.0 - updateText + updateWidgets .t yview scroll 2 pages .t index @0,0 } {66.0} test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} {textfonts} { .t yview 98.0 - updateText + updateWidgets .t yview scroll 1 page set res [expr {int([.t index @0,0])}] if {$fixedDiff > 1} { @@ -2190,24 +2184,24 @@ test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} { } {102} test textDisp-16.29 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t configure -height 1 - updateText + updateWidgets .t yview 50.0 - updateText + updateWidgets .t yview scroll 1 pages set x [.t index @0,0] .t configure -height 10 - updateText + updateWidgets set x } {51.0} test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 45.0 - updateText + updateWidgets .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-16.31 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 149.0 - updateText + updateWidgets .t yview scroll 4 units .t index @0,0 } {151.40} @@ -2312,7 +2306,7 @@ test textDisp-16.42 {TkTextYviewCmd procedure with indices in elided lines} { .t tag configure hidden -elide true .t yview 35.0 .t yview scroll [expr {- 15 * $fixedHeight}] pixels - updateText + updateWidgets .t index @0,0 } {5.0} test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { @@ -2326,7 +2320,7 @@ test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { .t tag configure hidden -elide true .t yview 35.0 .t yview scroll -15 units - updateText + updateWidgets .t index @0,0 } {5.0} test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { @@ -2337,9 +2331,9 @@ test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { .t insert end "$x 1111\n$x 2222\n$x 3333\n$x 4444\n$x 5555\n$x 6666" hidden } .t tag configure hidden -elide true ; # 5 hidden lines - updateText + updateWidgets .t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0 - updateText + updateWidgets .t index @0,0 } {2.0} @@ -2367,61 +2361,61 @@ test textDisp-17.5 {TkTextScanCmd procedure} { test textDisp-17.6 {TkTextScanCmd procedure} {textfonts} { .t yview 1.0 .t xview moveto 0 - updateText + updateWidgets .t scan mark 40 60 .t scan dragto 35 55 - updateText + updateWidgets .t index @0,0 } {4.7} test textDisp-17.7 {TkTextScanCmd procedure} {textfonts} { .t yview 10.0 .t xview moveto 0 - updateText + updateWidgets .t xview scroll 20 units - updateText + updateWidgets .t scan mark -10 60 .t scan dragto -5 65 - updateText + updateWidgets .t index @0,0 set x [.t index @0,0] .t scan dragto 0 [expr {70 + $fixedDiff}] - updateText + updateWidgets list $x [.t index @0,0] } {6.12 2.5} test textDisp-17.8 {TkTextScanCmd procedure} {textfonts} { .t yview 1.0 .t xview moveto 0 - updateText + updateWidgets .t scan mark 0 60 .t scan dragto 30 100 - updateText + updateWidgets .t scan dragto 25 95 - updateText + updateWidgets .t index @0,0 } {4.7} test textDisp-17.9 {TkTextScanCmd procedure} {textfonts} { .t yview end .t xview moveto 0 - updateText + updateWidgets .t xview scroll 100 units - updateText + updateWidgets .t scan mark 90 60 .t scan dragto 10 0 - updateText + updateWidgets .t scan dragto 14 5 - updateText + updateWidgets .t index @0,0 } {14.44} .t configure -wrap word test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} {textfonts} { .t yview 10.0 - updateText + updateWidgets .t scan mark -10 60 .t scan dragto -5 65 - updateText + updateWidgets set x [.t index @0,0] .t scan dragto 0 [expr {70 + $fixedDiff}] - updateText + updateWidgets list $x [.t index @0,0] } {9.0 8.0} .t configure -xscrollcommand scroll -yscrollcommand {} @@ -2431,7 +2425,7 @@ test textDisp-18.1 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateText + updateWidgets set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-18.2 {GetXView procedure} { @@ -2440,13 +2434,13 @@ test textDisp-18.2 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateText + updateWidgets set scrollInfo } {0.0 1.0} test textDisp-18.3 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end - updateText + updateWidgets set scrollInfo } {0.0 1.0} test textDisp-18.4 {GetXView procedure} { @@ -2455,7 +2449,7 @@ test textDisp-18.4 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxx\n .t insert end xxxxxxxxxxxxxxxxx - updateText + updateWidgets set scrollInfo } {0.0 1.0} test textDisp-18.5 {GetXView procedure} { @@ -2465,7 +2459,7 @@ test textDisp-18.5 {GetXView procedure} { .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx .t xview scroll 31 units - updateText + updateWidgets set scrollInfo } [list [expr {31.0/55}] [expr {51.0/55}]] test textDisp-18.6 {GetXView procedure} { @@ -2476,27 +2470,27 @@ test textDisp-18.6 {GetXView procedure} { .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" .t xview moveto 0 .t xview scroll 31 units - updateText + updateWidgets set x {} lappend x $scrollInfo .t configure -wrap char - updateText + updateWidgets lappend x $scrollInfo .t configure -wrap word - updateText + updateWidgets lappend x $scrollInfo .t configure -wrap none - updateText + updateWidgets lappend x $scrollInfo } [list [list [expr {31.0/56}] [expr {51.0/56}]] {0.0 1.0} {0.0 1.0} [list 0.0 [expr {5.0/14}]]] test textDisp-18.7 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end - updateText + updateWidgets set scrollInfo unchanged .t insert end xxxxxx\n .t insert end xxx - updateText + updateWidgets set scrollInfo } {unchanged} test textDisp-18.8 {GetXView procedure} { @@ -2510,10 +2504,10 @@ test textDisp-18.8 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n - updateText + updateWidgets .t delete 1.0 end .t configure -xscrollcommand scrollError - updateText + updateWidgets set x } {{scrolling error} {scrolling error while executing @@ -2530,37 +2524,37 @@ catch {rename bogus {}} test textDisp-19.1 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateText + updateWidgets set scrollInfo } {0.0 1.0} test textDisp-19.2 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateText + updateWidgets set scrollInfo "unchanged" .t insert 1.0 "Line1\nLine2" - updateText + updateWidgets set scrollInfo } {unchanged} test textDisp-19.3 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateText + updateWidgets set scrollInfo "unchanged" .t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateText + updateWidgets set scrollInfo } {unchanged} test textDisp-19.4 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1" - updateText + updateWidgets set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - updateText + updateWidgets set scrollInfo } [list 0.0 [expr {70.0/91}]] test textDisp-19.5 {GetYView procedure} { @@ -2571,7 +2565,7 @@ test textDisp-19.5 {GetYView procedure} { .t insert end "\nLine $i" } .t insert 2.end " is really quite long; in fact it's so long that it wraps three times" - updateText + updateWidgets set x $scrollInfo } {0.0 0.625} test textDisp-19.6 {GetYView procedure} { @@ -2583,7 +2577,7 @@ test textDisp-19.6 {GetYView procedure} { } .t insert 2.end " is really quite long; in fact it's so long that it wraps three times" .t yview 4.0 - updateText + updateWidgets set x $scrollInfo } {0.375 1.0} test textDisp-19.7 {GetYView procedure} { @@ -2595,7 +2589,7 @@ test textDisp-19.7 {GetYView procedure} { } .t insert 2.end " is really quite long; in fact it's so long that it wraps three times" .t yview 2.26 - updateText + updateWidgets set x $scrollInfo } {0.125 0.75} test textDisp-19.8 {GetYView procedure} failsOnUbuntu { @@ -2607,7 +2601,7 @@ test textDisp-19.8 {GetYView procedure} failsOnUbuntu { } .t insert 10.end " is really quite long; in fact it's so long that it wraps three times" .t yview 2.0 - updateText + updateWidgets .t count -update -ypixels 1.0 end set x $scrollInfo } {0.0625 0.6875} @@ -2619,7 +2613,7 @@ test textDisp-19.9 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 3.0 - updateText + updateWidgets set scrollInfo } [list [expr {4.0/30}] 0.8] test textDisp-19.10 {GetYView procedure} { @@ -2630,7 +2624,7 @@ test textDisp-19.10 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 11.0 - updateText + updateWidgets set scrollInfo } [list [expr {1.0/3}] 1.0] test textDisp-19.10.1 {Widget manipulation causes height miscount} { @@ -2641,7 +2635,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} { .t insert end "\nLine $i" } .t yview 11.0 - updateText + updateWidgets .t configure -wrap word .t delete 1.0 end .t insert 1.0 "Line 1" @@ -2651,7 +2645,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." .t yview insert - updateText + updateWidgets .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -2665,7 +2659,7 @@ test textDisp-19.11 {GetYView procedure} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." .t yview insert - updateText + updateWidgets .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -2803,10 +2797,10 @@ test textDisp-19.12 {GetYView procedure, partially visible last line} { pack .top.t -expand yes -fill both .top.t insert end "Line 1\nLine 2\nLine 3\nLine 4\nLine 5" # Need to wait for asychronous calculations to complete. - updateText + updateWidgets scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - updateText + updateWidgets .top.t yview } [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]] test textDisp-19.13 {GetYView procedure, partially visible last line} {textfonts} { @@ -2817,10 +2811,10 @@ test textDisp-19.13 {GetYView procedure, partially visible last line} {textfonts pack .top.t -expand yes -fill both .top.t insert end "Line 1\nLine 2\nLine 3\nLine 4 has enough text to wrap around at least once" # Need to wait for asychronous calculations to complete. - updateText + updateWidgets scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - updateText + updateWidgets .top.t yview } [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]] catch {destroy .top} @@ -2834,14 +2828,14 @@ test textDisp-19.14 {GetYView procedure} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." # Need to update so everything is calculated. - updateText + updateWidgets .t count -update -ypixels 1.0 end delay set scrollInfo "unchanged" .t mark set insert 3.0 .t tag configure x -background red .t tag add x 1.0 5.0 - updateText + updateWidgets .t tag delete x set scrollInfo } {unchanged} @@ -2854,14 +2848,14 @@ test textDisp-19.15 {GetYView procedure} { } .t insert end "\nThis last line wraps around four " .t insert end "times with a bit little left on the last line." - updateText + updateWidgets .t configure -yscrollcommand scrollError proc bgerror args { global x errorInfo errorCode set x [list $args $errorInfo $errorCode] } .t delete 1.0 end - updateText + updateWidgets rename bgerror {} .t configure -yscrollcommand scroll set x @@ -2883,9 +2877,9 @@ test textDisp-19.16 {count -ypixels} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." # Need to update so everything is calculated. - updateText + updateWidgets .t count -update -ypixels 1.0 end - updateText + updateWidgets set res {} lappend res \ [.t count -ypixels 1.0 end] \ @@ -2936,7 +2930,7 @@ test textDisp-19.18 {count -ypixels with indices in elided lines} {failsOnUbuntu update lappend res [.t count -ypixels 5.0 25.0] .t yview scroll [expr {- 15 * $fixedHeight}] pixels - updateText + updateWidgets lappend res [.t count -ypixels 5.0 25.0] } [list [expr {5 * $fixedHeight}] [expr {5 * $fixedHeight}]] test textDisp-19.19 {count -ypixels with indices in elided lines} { @@ -2949,7 +2943,7 @@ test textDisp-19.19 {count -ypixels with indices in elided lines} { .t tag add hidden 5.27 11.0 .t tag configure hidden -elide true .t yview 5.0 - updateText + updateWidgets set res [list [.t count -ypixels 5.0 11.0] [.t count -ypixels 5.0 11.20]] } [list [expr {1 * $fixedHeight}] [expr {2 * $fixedHeight}]] .t delete 1.0 end @@ -3041,7 +3035,7 @@ for {set i 2} {$i <= 200} {incr i} { .t configure -wrap word .t delete 50.0 51.0 .t insert 50.0 "This is a long line, one that will wrap around twice.\n" -updateText +updateWidgets .t tag add x 50.1 test textDisp-22.1 {TkTextCharBbox} {textfonts} { .t config -wrap word @@ -3058,21 +3052,21 @@ test textDisp-22.3 {TkTextCharBbox, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - updateText + updateWidgets list [.t bbox 19.1] [.t bbox 20.1] } [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] [list 10 [expr {3+10*$fixedHeight}] 7 3]] test textDisp-22.4 {TkTextCharBbox, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - updateText + updateWidgets list [.t bbox 19.1] [.t bbox 20.1] } [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] [list 10 [expr {3+10*$fixedHeight}] 7 5]] test textDisp-22.5 {TkTextCharBbox, cut-off char} {textfonts} { .t config -wrap none .t yview 10.0 wm geom . [expr {$width-95}]x$height - updateText + updateWidgets .t bbox 15.6 } [list 45 [expr {3+5*$fixedHeight}] 7 $fixedHeight] test textDisp-22.6 {TkTextCharBbox, line visible but not char} {textfonts} { @@ -3080,16 +3074,16 @@ test textDisp-22.6 {TkTextCharBbox, line visible but not char} {textfonts} { .t yview 10.0 .t tag add big 20.2 20.5 wm geom . ${width}x[expr {$height+3}] - updateText + updateWidgets list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2] } [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] {} [list 17 [expr {3+10*$fixedHeight}] 14 7]] wm geom . {} -updateText +updateWidgets test textDisp-22.7 {TkTextCharBbox, different character sizes} {textfonts} { .t config -wrap char .t yview 10.0 .t tag add big 12.2 12.5 - updateText + updateWidgets list [.t bbox 12.1] [.t bbox 12.2] } [list [list 10 [expr {3 + 2*$fixedHeight + $ascentDiff}] 7 $fixedHeight] [list 17 [expr {3+ 2*$fixedHeight}] 14 27]] .t tag remove big 1.0 end @@ -3116,7 +3110,7 @@ test textDisp-22.9 {TkTextCharBbox, handling of spacing} {textfonts} { .t window create 1.7 -window .t.f2 -align center .t window create 2.1 -window .t.f3 -align bottom .t window create 2.10 -window .t.f4 -align baseline - updateText + updateWidgets list [.t bbox .t.f1] [.t bbox .t.f2] [.t bbox .t.f3] [.t bbox .t.f4] \ [.t bbox 1.1] [.t bbox 2.9] } [list [list 24 11 10 4] [list 55 [expr {$fixedDiff/2 + 15}] 10 4] [list 10 [expr {2*$fixedDiff + 43}] 10 4] [list 76 [expr {2*$fixedDiff + 40}] 10 4] [list 10 11 7 $fixedHeight] [list 69 [expr {$fixedDiff + 34}] 7 $fixedHeight]] @@ -3130,7 +3124,7 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {textfonts} { .t tag add hidden 2.8 2.13 .t tag add hidden 6.8 7.13 .t tag configure hidden -elide true - updateText + updateWidgets list \ [expr {[lindex [.t bbox 2.9] 0] - [lindex [.t bbox 2.8] 0]}] \ [expr {[lindex [.t bbox 2.10] 0] - [lindex [.t bbox 2.8] 0]}] \ @@ -3152,7 +3146,7 @@ test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} {textfont } .t tag add hidden 1.30 2.5 .t tag configure hidden -elide true - updateText + updateWidgets list \ [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.4] 0]}] \ [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.5] 0]}] @@ -3166,7 +3160,7 @@ for {set i 2} {$i <= 200} {incr i} { .t configure -wrap word .t delete 50.0 51.0 .t insert 50.0 "This is a long line, one that will wrap around twice.\n" -updateText +updateWidgets test textDisp-23.1 {TkTextDLineInfo} {textfonts} { .t config -wrap word .t yview 48.0 @@ -3175,14 +3169,14 @@ test textDisp-23.1 {TkTextDLineInfo} {textfonts} { } [list {} [list 3 3 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {4*$fixedDiff + 55}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] test textDisp-23.2 {TkTextDLineInfo} {textfonts} { .t config -bd 4 -wrap word - updateText + updateWidgets .t yview 48.0 .t dlineinfo 50.40 } [list 7 [expr {4*$fixedDiff + 59}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] .t config -bd 0 test textDisp-23.3 {TkTextDLineInfo} {textfonts} { .t config -wrap none - updateText + updateWidgets .t yview 48.0 list [.t dlineinfo 50.40] [.t dlineinfo 57.3] } [list [list 3 [expr {2*$fixedDiff + 29}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]] @@ -3190,18 +3184,18 @@ test textDisp-23.4 {TkTextDLineInfo, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - updateText + updateWidgets list [.t dlineinfo 19.0] [.t dlineinfo 20.0] } [list [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {10*$fixedDiff + 133}] 49 3 [expr {$fixedDiff + 10}]]] test textDisp-23.5 {TkTextDLineInfo, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - updateText + updateWidgets list [.t dlineinfo 19.0] [.t dlineinfo 20.0] } [list [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {10*$fixedDiff + 133}] 49 5 [expr {$fixedDiff + 10}]]] wm geom . {} -updateText +updateWidgets test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {textfonts} { .t config -wrap none .t delete 1.0 end @@ -3209,7 +3203,7 @@ test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {textfonts} { .t insert end "Second line is a very long one that doesn't all fit.\n" .t insert end "Third" .t xview scroll 6 units - updateText + updateWidgets list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0] } [list [list -39 3 70 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list -39 [expr {$fixedDiff + 16}] 364 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list -39 [expr {2*$fixedDiff + 29}] 35 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]] .t xview moveto 0 @@ -3238,7 +3232,7 @@ test textDisp-24.2 {TkTextCharLayoutProc} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width+1}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 12 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.3 {TkTextCharLayoutProc} {textfonts} { @@ -3246,7 +3240,7 @@ test textDisp-24.3 {TkTextCharLayoutProc} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width-1}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 10 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {textfonts} { @@ -3254,7 +3248,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {textfonts} { .t delete 1.0 end .t insert 1.0 01234567890123456789\n012345678901234567890 wm geom . {} - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] [.t bbox 2.20] } [list [list 136 3 7 $fixedHeight] [list 143 3 0 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]] test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} {unix textfonts} { @@ -3262,7 +3256,7 @@ test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} .t delete 1.0 end .t insert 1.0 0\n1\n wm geom . 110x$height - updateText + updateWidgets list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 2.0] } [list [list 3 3 4 $fixedHeight] [list 7 3 0 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 4 $fixedHeight]] test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3270,7 +3264,7 @@ test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {textfonts} { .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . {} - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3278,7 +3272,7 @@ test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {textfonts} { .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width+1}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 12 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3286,7 +3280,7 @@ test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {textfonts} { .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width-1}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 10 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3294,7 +3288,7 @@ test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {textfonts} { .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width-6}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 5 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3302,7 +3296,7 @@ test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {textfonts} { .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width-7}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 4 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't quite fit} {textfonts} { @@ -3310,7 +3304,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui .t delete 1.0 end .t insert 1.0 "01234567890123456789 \nabcdefg" wm geom . [expr {$width-2}]x$height - updateText + updateWidgets set result {} lappend result [.t bbox 1.21] [.t bbox 2.0] .t mark set insert 1.21 @@ -3329,7 +3323,7 @@ test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . {} - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] {}] test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {textfonts} { @@ -3337,7 +3331,7 @@ test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width+1}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 143 3 5 $fixedHeight]] test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {textfonts} { @@ -3345,7 +3339,7 @@ test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width-1}]x$height - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 143 3 3 $fixedHeight]] test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} { @@ -3356,7 +3350,7 @@ test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . 103x$height - updateText + updateWidgets list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2] } [list [list 3 3 1 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 1 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 1 $fixedHeight]] if {[tk windowingsystem] == "win32"} { @@ -3367,7 +3361,7 @@ test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} {textfonts} { .t delete 1.0 end .t insert 1.0 "This is a line that wraps around" wm geom . {} - updateText + updateWidgets list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {textfonts} { @@ -3375,7 +3369,7 @@ test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {textfonts} { .t delete 1.0 end .t insert 1.0 "xxThis is a line that wraps around" wm geom . {} - updateText + updateWidgets list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17] } [list [list 108 3 7 $fixedHeight] [list 115 3 28 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {textfonts} { @@ -3383,7 +3377,7 @@ test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {textfonts} { .t delete 1.0 end .t insert 1.0 "xxThis is a line that wraps around" wm geom . {} - updateText + updateWidgets list [.t bbox 1.14] [.t bbox 1.15] [.t bbox 1.16] } [list [list 101 3 7 $fixedHeight] [list 108 3 7 $fixedHeight] [list 115 3 28 $fixedHeight]] test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {textfonts} { @@ -3401,7 +3395,7 @@ test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {textfonts} { set result } [list [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 19}] [expr {$fixedDiff + 16}]] [list 10 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 15}] [expr {$fixedDiff + 10}]]] .t configure -width 30 -updateText +updateWidgets test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {textfonts} { .t configure -wrap word .t delete 1.0 end @@ -3431,7 +3425,7 @@ test textDisp-24.23 {TkTextCharLayoutProc, word breaks} {textfonts} { } [list 3 [expr {2*$fixedDiff + 29}] 30 20] catch {destroy .t.f} .t configure -width 20 -updateText +updateWidgets test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} { .t delete 1.0 end .t tag configure x -justify center @@ -3444,7 +3438,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints pack .tt } -body { .tt insert end \t9\n\t99\n\t999 - updateText + updateWidgets list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3] } -cleanup { destroy .tt @@ -3452,7 +3446,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \ -tabs 100 -updateText +updateWidgets test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} { .t delete 1.0 end .t insert 1.0 abc\td\tfgh @@ -3461,7 +3455,7 @@ test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} { .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \ -tabs {} -updateText +updateWidgets test textDisp-26.1 {AdjustForTab procedure, no tabs} {textfonts} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -3584,7 +3578,7 @@ test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} { .t tag add y 1.9 button .b -text "=" .t window create 1.3 -window .b - updateText + updateWidgets lindex [.t bbox 1.5] 0 } {120} test textDisp-26.13 {AdjustForTab procedure, not enough space} {textfonts} { @@ -3631,7 +3625,7 @@ test textDisp-26.14.2 {AdjustForTab procedure, not enough space} {textfonts} { .t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \ -wrap char -updateText +updateWidgets test textDisp-27.1 {SizeOfTab procedure, old-style tabs} {textfonts} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -3700,7 +3694,7 @@ test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential # Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding, # so must we. set tab [expr {4 + int(0.5 + $tab + $cm)}] - updateText + updateWidgets set res [.t bbox 2.23] lset res 0 [expr {[lindex $res 0] - $tab}] set res @@ -3721,7 +3715,7 @@ test textDisp-27.7.1 {SizeOfTab procedure, center alignment, wrap -none (potenti # Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding, # so must we. set tab [expr {4 + int(0.5 + $tab + $cm)}] - updateText + updateWidgets set res [.t bbox 2.23] .t configure -tabstyle tabular lset res 0 [expr {[lindex $res 0] - $tab}] @@ -3736,17 +3730,17 @@ test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem} } .t configure -tabs $interpolatetab -wrap none -width 150 .t insert 1.0 [string repeat "a\t" 20] - updateText + updateWidgets set res [.t bbox 1.20] # Now, Tk's interpolated tabs should be the same as # non-interpolated. .t configure -tabs $precisetab - updateText + updateWidgets expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]} } {0} .t configure -wrap char -tabs {} -width 20 -updateText +updateWidgets test textDisp-27.8 {SizeOfTab procedure, right alignment} {textfonts} { .t delete 1.0 end .t insert 1.0 a\t\txyzzyabc @@ -3790,11 +3784,11 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} { .t2.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n" pack .t2.t wm geometry .t2 +0+0 - updateText + updateWidgets .t2.t configure -yscrollcommand bizarre_scroll .t2.t yview 100.0 set result [.t2.t index @0,0] - updateText + updateWidgets lappend result [.t2.t index @0,0] } {6.0 1.0} @@ -3810,7 +3804,7 @@ test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateText + updateWidgets list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list 0.0 [expr {20.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]] test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3825,9 +3819,9 @@ test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateText + updateWidgets .t2.t xview scroll 1 unit - updateText + updateWidgets list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - $fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - $fixedWidth}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]] test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3841,9 +3835,9 @@ test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfon pack .t2.s -side bottom -fill x .t2.t insert end 1\n .t2.t insert end [string repeat "abc" 30] - updateText + updateWidgets .t2.t xview scroll 5 unit - updateText + updateWidgets .t2.t xview } [list [expr {5.0/90}] [expr {25.0/90}]] test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3858,9 +3852,9 @@ test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} {textfon .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateText + updateWidgets .t2.t xview scroll 2 unit - updateText + updateWidgets list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - 2*$fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}] test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3875,9 +3869,9 @@ test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfon .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateText + updateWidgets .t2.t xview scroll 7 pixels - updateText + updateWidgets list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth + 7)/300}]] 300x50+[expr {$twbw + $twht + 1 - 7}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - 7}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]] test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3892,9 +3886,9 @@ test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfon .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateText + updateWidgets .t2.t xview scroll 17 pixels - updateText + updateWidgets list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth + 17)/300}]] 300x50+[expr {$twbw + $twht + 1 - 17}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}] test textDisp-29.2.5 {miscellaneous: can show last character} { @@ -3911,7 +3905,7 @@ test textDisp-29.2.5 {miscellaneous: can show last character} { grid columnconfigure .t2 0 -weight 1 grid rowconfigure .t2 0 -weight 1 grid rowconfigure .t2 1 -weight 0 - updateText + updateWidgets set xv [.t2.t xview] set xd [expr {[lindex $xv 1] - [lindex $xv 0]}] .t2.t xview moveto [expr {1.0-$xd}] @@ -3937,9 +3931,9 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} {textfonts .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateText + updateWidgets .t2.t xview scroll 200 units - updateText + updateWidgets list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {16.0/30}] 1.0] 300x50+-155+[expr {$fixedDiff + 18}] {}] test textDisp-30.1 {elidden text joining multiple logical lines} { @@ -3959,7 +3953,7 @@ test textDisp-30.2 {elidden text joining multiple logical lines} { catch {destroy .t2} .t configure -height 1 -updateText +updateWidgets test textDisp-31.1 {line embedded window height update} failsOnUbuntu { set res {} @@ -3977,7 +3971,7 @@ test textDisp-31.1 {line embedded window height update} failsOnUbuntu { test textDisp-31.2 {line update index shifting} failsOnUbuntu { set res {} .t.f configure -height 100 - updateText + updateWidgets lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -3999,7 +3993,7 @@ test textDisp-31.3 {line update index shifting} failsOnUbuntu { # have been performed. set res {} .t.f configure -height 100 - updateText + updateWidgets lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -4020,7 +4014,7 @@ test textDisp-31.4 {line embedded image height update} { image create photo textest -height 100 -width 10 .t delete 3.0 .t image create 3.0 -image textest - updateText + updateWidgets lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 lappend res [.t count -ypixels 1.0 end] @@ -4031,7 +4025,7 @@ test textDisp-31.4 {line embedded image height update} { test textDisp-31.5 {line update index shifting} failsOnUbuntu { set res {} textest configure -height 100 - updateText + updateWidgets lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 .t insert 1.0 "abc\n" @@ -4095,19 +4089,19 @@ test textDisp-32.0 {everything elided} { .tt insert 0.0 HELLO .tt tag configure HIDE -elide 1 .tt tag add HIDE 0.0 end - updateText + updateWidgets destroy .tt } {} test textDisp-32.1 {everything elided} { # Must not crash pack [text .tt] - updateText + updateWidgets .tt insert 0.0 HELLO - updateText + updateWidgets .tt tag configure HIDE -elide 1 - updateText + updateWidgets .tt tag add HIDE 0.0 end - updateText + updateWidgets destroy .tt } {} test textDisp-32.2 {elide and tags} { @@ -4118,11 +4112,11 @@ test textDisp-32.2 {elide and tags} { {testtag1 testtag3} \ {[this bit here uses tags 2 and 3]} \ {testtag2 testtag3} - updateText + updateWidgets # indent left margin of tag 1 by 20 pixels # text should be indented .tt tag configure testtag1 -lmargin1 20 - updateText + updateWidgets #1 set res {} lappend res [list [.tt index "1.0 + 0 displaychars"] \ @@ -4131,7 +4125,7 @@ test textDisp-32.2 {elide and tags} { # hide tag 1, remaining text should not be indented, since # the indented tag and character is hidden. .tt tag configure testtag1 -elide 1 - updateText + updateWidgets #2 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4142,7 +4136,7 @@ test textDisp-32.2 {elide and tags} { # indent left margin of tag 2 by 20 pixels # text should not be indented, since tag1 has lmargin1 of 0. .tt tag configure testtag2 -lmargin1 20 - updateText + updateWidgets #3 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4151,7 +4145,7 @@ test textDisp-32.2 {elide and tags} { # the bbox of 1.0 should have zero width and zero indent, # since it is elided at that position. .tt tag configure testtag1 -elide 1 - updateText + updateWidgets #4 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4164,7 +4158,7 @@ test textDisp-32.2 {elide and tags} { # precedence over testtag1, and is applied to the # start of the text. .tt tag configure testtag3 -lmargin1 20 - updateText + updateWidgets #5 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4173,7 +4167,7 @@ test textDisp-32.2 {elide and tags} { # since it still has testtag3 on it. Again the # bbox of 1.0 should have 0. .tt tag configure testtag1 -elide 1 - updateText + updateWidgets #6 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4211,7 +4205,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup { .tt insert end ":)" emoticon .tt image create end -image $img pack .tt - updateText + updateWidgets } -cleanup { image delete $img destroy .tt @@ -4233,18 +4227,18 @@ test textDisp-32.4 {Button-1 click with elided lines - Bug 18371b7ce7} -setup { test textDisp-33.0 {one line longer than fits in the widget} { pack [text .tt -wrap char] - updateText + updateWidgets .tt insert 1.0 [string repeat "more wrap + " 300] - updateText + updateWidgets .tt see 1.0 lindex [.tt yview] 0 } {0.0} test textDisp-33.1 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] - updateText + updateWidgets .tt insert 1.0 [string repeat "more wrap + " 300] - updateText + updateWidgets .tt yview "1.0 +1 displaylines" if {[lindex [.tt yview] 0] > 0.1} { set result "window should be scrolled to the top" @@ -4256,7 +4250,7 @@ test textDisp-33.2 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] .tt debug 1 - updateText + updateWidgets set tk_textHeightCalc "" set timer [after 200 lappend tk_textHeightCalc "Timed out"] .tt insert 1.0 [string repeat "more wrap + " 1] @@ -4270,9 +4264,9 @@ test textDisp-33.3 {one line longer than fits in the widget} { .tt debug 1 set tk_textHeightCalc "" .tt insert 1.0 [string repeat "more wrap + " 300] - updateText + updateWidgets .tt count -update -ypixels 1.0 end - updateText + updateWidgets # Each line should have been recalculated just once .tt debug 0 expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]} @@ -4283,7 +4277,7 @@ test textDisp-33.4 {one line longer than fits in the widget} { .tt debug 1 set tk_textHeightCalc "" .tt insert 1.0 [string repeat "more wrap + " 300] - updateText + updateWidgets set idx [.tt index "1.0 + 1 displaylines"] .tt yview $idx if {[lindex [.tt yview] 0] > 0.1} { @@ -4305,7 +4299,7 @@ test textDisp-33.5 {bold or italic fonts} win { .tt tag configure bi -font bi .tt tag configure no -font no .tt insert end abcd no efgh bi ijkl\n no - updateText + updateWidgets set bb {} for {set i 0} {$i < 12} {incr i 4} { lappend bb [lindex [.tt bbox 1.$i] 0] @@ -4332,7 +4326,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { .t1 debug 1 set ge [winfo geometry .] scan $ge "%dx%d+%d+%d" width height left top - updateText + updateWidgets .t1 sync set negative 0 bind .t1 <> { if {%d < 0} {set negative 1} } @@ -4342,7 +4336,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { # Thus we use this way to check for regression regarding bug 2677890, # i.e. to check that the fix for this bug really is still in. wm geometry . "[expr {$width * 2}]x$height+$left+$top" - updateText + updateWidgets .t1 sync set negative } -cleanup { -- cgit v0.12 From 611df5c027dad939938cc031752715957ef9670b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 10 Apr 2022 19:49:08 +0000 Subject: Adjust unixEmbed-10.1 and unixEmbed-10.2 and remove constraints failsOnUbuntu and failsOnXQuarz. --- tests/unixEmbed.test | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index d5f6ee3..ae04079 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1236,33 +1236,33 @@ test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constrain test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { - unix failsOnUbuntu failsOnXQuarz + unix } -setup { deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 - update idletasks + updateWidgets toplevel .t1 -use [winfo id .f1] -width 150 -height 80 - update idletasks + updateWidgets wm geometry .t1 +40+50 - update idletasks + updateWidgets wm geometry .t1 } -cleanup { deleteWindows } -result {150x80+0+0} test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { - unix failsOnUbuntu failsOnXQuarz + unix } -setup { deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 - update idletasks + updateWidgets toplevel .t1 -use [winfo id .f1] -width 150 -height 80 - update idletasks + updateWidgets wm geometry .t1 70x300+10+20 - update idletasks + updateWidgets wm geometry .t1 } -cleanup { deleteWindows -- cgit v0.12 From d1eed980cbe2721adb4fed857b96804a955f77dd Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 10 Apr 2022 19:58:20 +0000 Subject: Fix indentation in unixEmbed.test --- tests/unixEmbed.test | 388 +++++++++++++++++++++++++-------------------------- 1 file changed, 194 insertions(+), 194 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index ae04079..ba441e2 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -91,23 +91,23 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} { testConstraint pressbutton [llength [info commands pressbutton]] test unixEmbed-1.1 {TkpUseWindow procedure, bad window identifier} -constraints { - unix + unix } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -use xyz } -returnCodes error -result {expected integer but got "xyz"} test unixEmbed-1.2 {TkpUseWindow procedure, bad window identifier} -constraints { - unix + unix } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -use 47 } -returnCodes error -result {couldn't create child of window "47"} test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints { - unix nonPortable + unix nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -colormap new wm geometry .t +0+0 @@ -116,12 +116,12 @@ test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints { toplevel .x -use [winfo id .t.f] colorsFree .x } -cleanup { - deleteWindows + deleteWindows } -result {0} test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints { - unix nonPortable + unix nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -container 1 -colormap new wm geometry .t +0+0 @@ -129,13 +129,13 @@ test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints { toplevel .x -use [winfo id .t] colorsFree .x } -cleanup { - deleteWindows + deleteWindows } -result {1} test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constraints { - unix testembed notAqua + unix testembed notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 frame .f2 -container 1 -width 200 -height 50 @@ -147,7 +147,7 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constra list [testembed] [expr [lindex [lindex [testembed all] 0] 0] - $w] } } -cleanup { - deleteWindows + deleteWindows } -result {{{XXX {} {} .t}} 0} test unixEmbed-1.5a {TkpUseWindow procedure, creating Container records} -constraints { unix testembed @@ -171,9 +171,9 @@ test unixEmbed-1.5a {TkpUseWindow procedure, creating Container records} -constr deleteWindows } -result {{{XXX {} {} .t}} 0} test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constraints { - unix testembed notAqua + unix testembed notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 frame .f2 -container 1 -width 200 -height 50 @@ -181,13 +181,13 @@ test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constra dobg "set w1 [winfo id .f1]" dobg "set w2 [winfo id .f2]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - toplevel .t2 -use $w2 - testembed + eval destroy [winfo child .] + toplevel .t1 -use $w1 + toplevel .t2 -use $w2 + testembed } } -cleanup { - deleteWindows + deleteWindows } -result {{XXX {} {} .t2} {XXX {} {} .t1}} test unixEmbed-1.6a {TkpUseWindow procedure, creating Container records} -constraints { unix testembed @@ -213,9 +213,9 @@ test unixEmbed-1.6a {TkpUseWindow procedure, creating Container records} -constr deleteWindows } -result {{XXX {} {} .t2} {XXX {} {} .t1}} test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} -constraints { - unix testembed + unix testembed } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 frame .f2 -container 1 -width 200 -height 50 @@ -224,7 +224,7 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} toplevel .t2 -use [winfo id .f2] testembed } -cleanup { - deleteWindows + deleteWindows } -result {{XXX .f2 {} .t2} {XXX .f1 {} .t1}} # Can't think of any way to test the procedures TkpMakeWindow, @@ -232,25 +232,25 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} test unixEmbed-2.1 {EmbeddedEventProc procedure} -constraints { - unix testembed notAqua + unix testembed notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - testembed + eval destroy [winfo child .] + toplevel .t1 -use $w1 + testembed } destroy .f1 update dobg { - testembed + testembed } } -cleanup { - deleteWindows + deleteWindows } -result {} test unixEmbed-2.1a {EmbeddedEventProc procedure} -constraints { unix testembed @@ -277,22 +277,22 @@ test unixEmbed-2.1a {EmbeddedEventProc procedure} -constraints { deleteWindows } -result {} test unixEmbed-2.2 {EmbeddedEventProc procedure} -constraints { - unix testembed notAqua + unix testembed notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - testembed - destroy .t1 - testembed + eval destroy [winfo child .] + toplevel .t1 -use $w1 + testembed + destroy .t1 + testembed } } -cleanup { - deleteWindows + deleteWindows } -result {} test unixEmbed-2.2a {EmbeddedEventProc procedure} -constraints { unix testembed @@ -317,9 +317,9 @@ test unixEmbed-2.2a {EmbeddedEventProc procedure} -constraints { deleteWindows } -result {} test unixEmbed-2.3 {EmbeddedEventProc procedure} -constraints { - unix testembed notAqua + unix testembed notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 @@ -329,9 +329,9 @@ test unixEmbed-2.3 {EmbeddedEventProc procedure} -constraints { testembed } -result {} test unixEmbed-2.4 {EmbeddedEventProc procedure} -constraints { - unix testembed + unix testembed } -setup { - deleteWindows + deleteWindows } -body { pack [frame .f1 -container 1 -width 200 -height 50] toplevel .t1 -use [winfo id .f1] @@ -341,7 +341,7 @@ test unixEmbed-2.4 {EmbeddedEventProc procedure} -constraints { update list $x [winfo exists .t1] [winfo exists .f1] [testembed] } -cleanup { - deleteWindows + deleteWindows } -result "{{XXX .f1 {} .t1}} 0 0 {}" @@ -353,13 +353,13 @@ test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} -constraints dobg "set w1 [winfo id .f1]" set x [testembed] dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - wm withdraw .t1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 + wm withdraw .t1 } list $x [testembed] } -cleanup { - deleteWindows + deleteWindows } -result {{{XXX .f1 {} {}}} {{XXX .f1 XXX {}}}} test unixEmbed-3.1a {ContainerEventProc procedure, detect creation} -constraints { unix testembed @@ -383,9 +383,9 @@ test unixEmbed-3.1a {ContainerEventProc procedure, detect creation} -constraints deleteWindows } -result {{{XXX .f1 {} {}}} {{XXX .f1 {} {}}}} test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} -constraints { - unix + unix } -setup { - deleteWindows + deleteWindows update } -body { toplevel .t1 -container 1 @@ -394,28 +394,28 @@ test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} -constra update wm geometry .t2 } -cleanup { - deleteWindows + deleteWindows } -result {200x200+0+0} test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 -bd 2 -relief raised - update - wm geometry .t1 +30+40 + eval destroy [winfo child .] + toplevel .t1 -use $w1 -bd 2 -relief raised + update + wm geometry .t1 +30+40 } update dobg { - wm geometry .t1 + wm geometry .t1 } } -cleanup { - deleteWindows + deleteWindows } -result {200x200+0+0} test unixEmbed-3.3a {ContainerEventProc procedure, disallow position changes} -constraints { unix @@ -441,25 +441,25 @@ test unixEmbed-3.3a {ContainerEventProc procedure, disallow position changes} -c deleteWindows } -result {200x200+0+0} test unixEmbed-3.4 {ContainerEventProc procedure, disallow position changes} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - update - wm geometry .t1 300x100+30+40 + eval destroy [winfo child .] + toplevel .t1 -use $w1 + update + wm geometry .t1 300x100+30+40 } update dobg { - wm geometry .t1 + wm geometry .t1 } } -cleanup { - deleteWindows + deleteWindows } -result {300x100+0+0} test unixEmbed-3.4a {ContainerEventProc procedure, disallow position changes} -constraints { unix @@ -485,25 +485,25 @@ test unixEmbed-3.4a {ContainerEventProc procedure, disallow position changes} -c deleteWindows } -result {300x100+0+0} test unixEmbed-3.5 {ContainerEventProc procedure, geometry requests} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 } update dobg { - .t1 configure -width 300 -height 80 + .t1 configure -width 300 -height 80 } update list [winfo width .f1] [winfo height .f1] [dobg {wm geometry .t1}] } -cleanup { - deleteWindows + deleteWindows } -result {300 80 300x80+0+0} test unixEmbed-3.5a {ContainerEventProc procedure, geometry requests} -constraints { unix @@ -528,27 +528,27 @@ test unixEmbed-3.5a {ContainerEventProc procedure, geometry requests} -constrain deleteWindows } -result {300 80 300x80+0+0} test unixEmbed-3.6 {ContainerEventProc procedure, map requests} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - set x unmapped - bind .t1 {set x mapped} + eval destroy [winfo child .] + toplevel .t1 -use $w1 + set x unmapped + bind .t1 {set x mapped} } update dobg { - after 100 - update - set x + after 100 + update + set x } } -cleanup { - deleteWindows + deleteWindows } -result {mapped} test unixEmbed-3.6a {ContainerEventProc procedure, map requests} -constraints { unix @@ -576,9 +576,9 @@ test unixEmbed-3.6a {ContainerEventProc procedure, map requests} -constraints { deleteWindows } -result {mapped} test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 @@ -586,17 +586,17 @@ test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints { bind .f1 {set x dead} set x alive dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 } update dobg { - destroy .t1 + destroy .t1 } update list $x [winfo exists .f1] } -cleanup { - deleteWindows + deleteWindows } -result {dead 0} test unixEmbed-3.7a {ContainerEventProc procedure, destroy events} -constraints { unix @@ -625,27 +625,27 @@ test unixEmbed-3.7a {ContainerEventProc procedure, destroy events} -constraints } -result {dead 0} test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 } update dobg { - .t1 configure -width 180 -height 100 + .t1 configure -width 180 -height 100 } update dobg { - winfo geometry .t1 + winfo geometry .t1 } } -cleanup { - deleteWindows + deleteWindows } -result {180x100+0+0} test unixEmbed-4.1a {EmbedStructureProc procedure, configure events} -constraints { unix @@ -671,16 +671,16 @@ test unixEmbed-4.1a {EmbedStructureProc procedure, configure events} -constraint deleteWindows } -result {180x100+0+0} test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} -constraints { - unix testembed notAqua + unix testembed notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 } update set x [testembed] @@ -688,7 +688,7 @@ test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} -constraints { update list $x [testembed] } -cleanup { - deleteWindows + deleteWindows } -result {{{XXX .f1 XXX {}}} {}} test unixEmbed-4.2a {EmbedStructureProc procedure, destroy events} -constraints { unix testembed @@ -716,25 +716,25 @@ test unixEmbed-4.2a {EmbedStructureProc procedure, destroy events} -constraints test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - bind .t1 {lappend x "focus in %W"} - bind .t1 {lappend x "focus out %W"} - set x {} + eval destroy [winfo child .] + toplevel .t1 -use $w1 + bind .t1 {lappend x "focus in %W"} + bind .t1 {lappend x "focus out %W"} + set x {} } focus -force .f1 update dobg {set x} } -cleanup { - deleteWindows + deleteWindows } -result {{focus in .t1}} test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints { unix @@ -763,9 +763,9 @@ test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints { deleteWindows } -result {{focus in .t1}} test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 @@ -776,13 +776,13 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constrai } update dobg { - after 200 {destroy .t1} + after 200 {destroy .t1} } after 400 focus -force .f1 update } -cleanup { - deleteWindows + deleteWindows } -result {} test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constraints { unix @@ -809,19 +809,19 @@ test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constra deleteWindows } -result {} test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - bind .t1 {lappend x "focus in %W"} - bind .t1 {lappend x "focus out %W"} - set x {} + eval destroy [winfo child .] + toplevel .t1 -use $w1 + bind .t1 {lappend x "focus in %W"} + bind .t1 {lappend x "focus out %W"} + set x {} } focus -force .f1 update @@ -830,7 +830,7 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints { update list $x [dobg {update; set x}] } -cleanup { - deleteWindows + deleteWindows } -result {{{focus in .t1}} {{focus in .t1} {focus out .t1}}} test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints { unix @@ -864,25 +864,25 @@ test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints { test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - update - bind .t1 {lappend x {configure .t1 %w %h}} - set x {} - .t1 configure -width 300 -height 120 - update - list $x [winfo geom .t1] + eval destroy [winfo child .] + toplevel .t1 -use $w1 + update + bind .t1 {lappend x {configure .t1 %w %h}} + set x {} + .t1 configure -width 300 -height 120 + update + list $x [winfo geom .t1] } } -cleanup { - deleteWindows + deleteWindows } -result {{{configure .t1 300 120}} 300x120+0+0} test unixEmbed-6.1a {EmbedGeometryRequest procedure, window changes size} -constraints { unix @@ -910,25 +910,25 @@ test unixEmbed-6.1a {EmbedGeometryRequest procedure, window changes size} -const deleteWindows } -result {{configure .t1 300 120} 300x120+0+0} test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 place .f1 -width 200 -height 200 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 - update - bind .t1 {lappend x {configure .t1 %w %h}} - set x {} - .t1 configure -width 300 -height 120 - update - list $x [winfo geom .t1] + eval destroy [winfo child .] + toplevel .t1 -use $w1 + update + bind .t1 {lappend x {configure .t1 %w %h}} + set x {} + .t1 configure -width 300 -height 120 + update + list $x [winfo geom .t1] } } -cleanup { - deleteWindows + deleteWindows } -result {{{configure .t1 200 200}} 200x200+0+0} test unixEmbed-6.2a {EmbedGeometryRequest procedure, window changes size} -constraints { unix @@ -960,32 +960,32 @@ test unixEmbed-6.2a {EmbedGeometryRequest procedure, window changes size} -const # Can't think up any tests for TkpGetOtherWindow procedure. test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { deleteWindows frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 } focus -force . bind . {lappend x {key %A %E}} set x {} set y [dobg { - update - bind .t1 {lappend y {key %A}} - set y {} - event generate .t1 -keysym a - set y + update + bind .t1 {lappend y {key %A}} + set y {} + event generate .t1 -keysym a + set y }] update list $x $y } -cleanup { - deleteWindows + deleteWindows bind . {} } -result {{{key a 1}} {}} # TkpRedirectKeyEvent is not implemented in win or aqua. If someone @@ -1024,16 +1024,16 @@ test unixEmbed-7.1a {TkpRedirectKeyEvent procedure, forward keystroke} -constrai bind . {} } -result {{{key a 1}} {}} test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints { - unix notAqua + unix notAqua } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 + eval destroy [winfo child .] + toplevel .t1 -use $w1 } update focus -force .f1 @@ -1041,16 +1041,16 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width bind . {lappend x {key %A}} set x {} set y [dobg { - update - bind .t1 {lappend y {key %A}} - set y {} - event generate .t1 -keysym b - set y + update + bind .t1 {lappend y {key %A}} + set y {} + event generate .t1 -keysym b + set y }] update list $x $y } -cleanup { - deleteWindows + deleteWindows bind . {} } -result {{} {{key b}}} test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints { @@ -1091,28 +1091,28 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt test unixEmbed-8.1 {TkpClaimFocus procedure} -constraints { unix notAqua failsOnUbuntu failsOnXQuarz } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 frame .f2 -width 200 -height 50 pack .f1 .f2 dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken + eval destroy [winfo child .] + toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken } focus -force .f2 update list [dobg { - focus .t1 - set x [list [focus]] - update - after 500 - update - lappend x [focus] + focus .t1 + set x [list [focus]] + update + after 500 + update + lappend x [focus] }] [focus] } -cleanup { - deleteWindows + deleteWindows } -result {{{} .t1} .f1} test unixEmbed-8.1a {TkpClaimFocus procedure} -constraints unix -setup { deleteWindows @@ -1155,25 +1155,25 @@ test unixEmbed-8.2 {TkpClaimFocus procedure} -constraints unix -setup { child eval "set argv {-use [winfo id .f1]}" load {} Tk child child eval { - . configure -bd 2 -highlightthickness 2 -relief sunken + . configure -bd 2 -highlightthickness 2 -relief sunken } focus -force .f2 update list [child eval { - focus . - set x [list [focus]] - update - lappend x [focus] + focus . + set x [list [focus]] + update + lappend x [focus] }] [focus] } -cleanup { - deleteWindows + deleteWindows } -result {{{} .} .f1} catch {interp delete child} test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} -constraints { - unix testembed + unix testembed } -setup { - deleteWindows + deleteWindows } -body { frame .f1 -container 1 -width 200 -height 50 frame .f2 -container 1 -width 200 -height 50 @@ -1183,12 +1183,12 @@ test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} -constraints set x {} lappend x [testembed] foreach w {.f3 .f4 .f1 .f2} { - destroy $w - lappend x [testembed] + destroy $w + lappend x [testembed] } set x } -cleanup { - deleteWindows + deleteWindows } -result {{{XXX .f4 {} {}} {XXX .f3 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f4 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}}} {}} test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} -constraints { unix testembed notAqua @@ -1200,15 +1200,15 @@ test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} -constraint update dobg "set w1 [winfo id .f1]" dobg { - eval destroy [winfo child .] - toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken - set x {} - lappend x [testembed] - destroy .t1 - lappend x [testembed] + eval destroy [winfo child .] + toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken + set x {} + lappend x [testembed] + destroy .t1 + lappend x [testembed] } } -cleanup { - deleteWindows + deleteWindows } -result {{{XXX {} {} .t1}} {}} test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constraints { unix testembed @@ -1249,7 +1249,7 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con updateWidgets wm geometry .t1 } -cleanup { - deleteWindows + deleteWindows } -result {150x80+0+0} test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { unix @@ -1265,7 +1265,7 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con updateWidgets wm geometry .t1 } -cleanup { - deleteWindows + deleteWindows } -result {70x300+0+0} test unixEmbed-11.1 {focus -force works for embedded toplevels} -constraints { @@ -1292,12 +1292,12 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { toplevel .main set result {} pack [button .main.b -text "Main Button" \ - -command {lappend result ".main.b"}] -padx 30 -pady 30 + -command {lappend result ".main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both update idletasks toplevel .embed -use [winfo id .main.f] -bg green pack [button .embed.b -text "Emb Button" \ - -command {lappend result ".embed.b"}] -padx 30 -pady 30 + -command {lappend result ".embed.b"}] -padx 30 -pady 30 wm geometry .main 200x400+100+100 update idletasks focus -force .main -- cgit v0.12 From d2e56779f7f55e9ab87632524ad5c2389e177273 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 10 Apr 2022 20:05:48 +0000 Subject: More updateWidgets in unixEmbed.test (instead of update idletasks) --- tests/unixEmbed.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index ba441e2..a66d54e 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1275,9 +1275,9 @@ test unixEmbed-11.1 {focus -force works for embedded toplevels} -constraints { } -body { toplevel .t pack [frame .t.f -container 1 -width 200 -height 200] -fill both - update idletasks + updateWidgets toplevel .embed -use [winfo id .t.f] -bg green - update idletasks + updateWidgets focus -force .t focus -force .embed focus @@ -1294,12 +1294,12 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { pack [button .main.b -text "Main Button" \ -command {lappend result ".main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both - update idletasks + updateWidgets toplevel .embed -use [winfo id .main.f] -bg green pack [button .embed.b -text "Emb Button" \ -command {lappend result ".embed.b"}] -padx 30 -pady 30 wm geometry .main 200x400+100+100 - update idletasks + updateWidgets focus -force .main after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] -- cgit v0.12 From ddce0e07988e4106eae786fe38c3452f18c3dc21 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 10 Apr 2022 20:18:16 +0000 Subject: Stabilize unixEmbed-11.2. This test was observed failing several times at GitHub Actions, on macOS (this is anyway a macOS-only test due to the 'pressbutton' constraint), with clang (mem, --enable-aqua). See [e4a05184e9]. --- tests/unixEmbed.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index a66d54e..9cd54c8 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1290,6 +1290,7 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { deleteWindows } -body { toplevel .main + wm geometry .main 200x400+100+100 set result {} pack [button .main.b -text "Main Button" \ -command {lappend result ".main.b"}] -padx 30 -pady 30 @@ -1298,8 +1299,8 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { toplevel .embed -use [winfo id .main.f] -bg green pack [button .embed.b -text "Emb Button" \ -command {lappend result ".embed.b"}] -padx 30 -pady 30 - wm geometry .main 200x400+100+100 updateWidgets + update focus -force .main after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] -- cgit v0.12 From cd6911f504e5a9b9fcdfdbd95d5d174c76a685d1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 07:42:53 +0000 Subject: Stabilize textWind-3.[2-6] and -11.[1-3] tests for the EmbWinConfigure and EmbWinDisplayProc procedures. At least textWind-3.3 and textWind-3.4 were observed to fail at GitHub, in branch unstable_tests, with xcode or clang (mem, --enable-aqua), or clang (no, --enable-aqua). --- tests/textWind.test | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index bf9ed41..bc5582f 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -54,7 +54,7 @@ wm deiconify . # This update is needed on MacOS to make sure that the window is mapped # when the tests begin. -update +updateText set bw [.t cget -borderwidth] set px [.t cget -padx] @@ -352,9 +352,9 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - update + updateText .t window configure 1.3 -window {} - update + updateText .t index .f } -cleanup { destroy .f @@ -366,10 +366,9 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - update + updateText .t window configure 1.3 -window {} - update - catch {.t index .f} + updateText list [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -382,9 +381,9 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - update + updateText .t window configure 1.3 -window {} - update + updateText .t index .t.f } -cleanup { destroy .t.f @@ -396,10 +395,9 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - update + updateText .t window configure 1.3 -window {} - update - catch {.t index .t.f} + updateText list [winfo ismapped .t.f] [.t bbox 1.4] } -cleanup { destroy .t.f @@ -412,9 +410,9 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 - update + updateText .t window configure 1.3 -window .f - update + updateText list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -967,14 +965,14 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup { place forget .t pack .t # Make sure the Text is mapped before we start - update + updateText } -body { .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - update + updateText winfo geom .f } -cleanup { destroy .f @@ -987,14 +985,14 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup { place forget .t pack .t # Make sure the Text is mapped before we start - update + updateText } -body { .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 frame .t.f -width 30 -height 20 -bg $color .t window create 1.12 -window .t.f - update + updateText winfo geom .t.f } -cleanup { destroy .t.f @@ -1008,17 +1006,17 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -se place forget .t pack .t # Make sure the Text is mapped before we start - update + updateText } -body { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - update + updateText bind .f {set x ".f configured"} set x {no configures} .t delete 1.0 .t insert 1.0 "X" - update + updateText return $x } -cleanup { destroy .f -- cgit v0.12 From ca202b638555a54252c5db53a0ddcc61ee37c90c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 07:43:16 +0000 Subject: Fix indentation in textWind.test --- tests/textWind.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index bc5582f..c0537ad 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -964,7 +964,7 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup { destroy .f place forget .t pack .t -# Make sure the Text is mapped before we start + # Make sure the Text is mapped before we start updateText } -body { .t insert 1.0 "Some sample text" @@ -984,7 +984,7 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup { destroy .t.f place forget .t pack .t -# Make sure the Text is mapped before we start + # Make sure the Text is mapped before we start updateText } -body { .t insert 1.0 "Some sample text" @@ -1005,7 +1005,7 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -se destroy .f place forget .t pack .t -# Make sure the Text is mapped before we start + # Make sure the Text is mapped before we start updateText } -body { .t insert 1.0 "Some sample text" -- cgit v0.12 From 13f1f80275899d04d2e1faf8cc69991b5c0742d2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 07:45:26 +0000 Subject: In textWind.test, use the common proc updateWidgets instead of specific proc updateText. --- tests/textWind.test | 228 +++++++++++++++++++++++++--------------------------- 1 file changed, 108 insertions(+), 120 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index c0537ad..6a3862c 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -11,18 +11,6 @@ namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands -# Platform specific procedure for updating the text widget. - -if {[tk windowingsystem] == "aqua"} { - proc updateText {} { - update idletasks - } -} else { - proc updateText {} { - update - } -} - deleteWindows set fixedFont {"Courier" -12} @@ -36,7 +24,7 @@ set tHeight 6 text .t -width $tWidth -height $tHeight -bd 2 -highlightthickness 2 \ -font $fixedFont pack .t -expand 1 -fill both -updateText +updateWidgets .t debug on set color [expr {[winfo depth .t] > 1 ? "green" : "black"}] @@ -54,7 +42,7 @@ wm deiconify . # This update is needed on MacOS to make sure that the window is mapped # when the tests begin. -updateText +updateWidgets set bw [.t cget -borderwidth] set px [.t cget -padx] @@ -72,7 +60,7 @@ test textWind-1.1 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 3 -height 3 -bg $color .t window create 2.2 -window .f - updateText + updateWidgets list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \ [.t window configure .f -window] } -result [list \ @@ -88,7 +76,7 @@ test textWind-1.2 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 3 -height 3 -bg $color .t window create 2.2 -window .f -align top - updateText + updateWidgets list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \ [.t window configure .f -align] } -result [list \ @@ -114,7 +102,7 @@ test textWind-1.4 {basic tests of options} -setup { # the window .f should be wider than the fixed width frame .f -width 10 -height 20 -bg $color .t window create 2.2 -window .f -padx 5 - updateText + updateWidgets list [winfo geom .f] [.t window configure .f -padx] [.t bbox 2.3] } -result [list \ 10x20+[expr {$padx+2*$fixedWidth+5}]+[expr {$pady+$fixedHeight}] \ @@ -128,7 +116,7 @@ test textWind-1.5 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 20 -bg $color .t window create 2.2 -window .f -pady 4 - updateText + updateWidgets list [winfo geom .f] [.t window configure .f -pady] [.t bbox 2.31] } -result [list \ 10x20+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight+4}] \ @@ -142,7 +130,7 @@ test textWind-1.6 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 5 -height 5 -bg $color .t window create 2.2 -window .f -stretch 1 - updateText + updateWidgets list [winfo geom .f] [.t window configure .f -stretch] } -result [list \ 5x$fixedHeight+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight}] \ @@ -205,7 +193,7 @@ test textWind-2.11 {TkTextWindowCmd procedure} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 6 -bg $color .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo - updateText + updateWidgets .t window configure .f } -cleanup { destroy .f @@ -221,7 +209,7 @@ test textWind-2.12 {TkTextWindowCmd procedure} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 6 -bg $color .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo - updateText + updateWidgets list [.t window configure .f -padx 33] [.t window configure .f -padx] } -cleanup { destroy .f @@ -237,7 +225,7 @@ test textWind-2.13 {TkTextWindowCmd procedure} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 6 -bg $color .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 - updateText + updateWidgets list [.t window configure .f -padx 14 -pady 15] \ [.t window configure .f -padx] [.t window configure .f -pady] } -cleanup { @@ -352,9 +340,9 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateText + updateWidgets .t window configure 1.3 -window {} - updateText + updateWidgets .t index .f } -cleanup { destroy .f @@ -366,9 +354,9 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateText + updateWidgets .t window configure 1.3 -window {} - updateText + updateWidgets list [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -381,9 +369,9 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateText + updateWidgets .t window configure 1.3 -window {} - updateText + updateWidgets .t index .t.f } -cleanup { destroy .t.f @@ -395,9 +383,9 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateText + updateWidgets .t window configure 1.3 -window {} - updateText + updateWidgets list [winfo ismapped .t.f] [.t bbox 1.4] } -cleanup { destroy .t.f @@ -410,9 +398,9 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 - updateText + updateWidgets .t window configure 1.3 -window .f - updateText + updateWidgets list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -467,7 +455,7 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { button .t.b -text "Hello!" .t window create 1.4 -window .t.b .t window create 1.6 -window .t.b - updateText + updateWidgets .t index .t.b } -result {1.6} @@ -508,7 +496,7 @@ test textWind-5.1 {EmbWinStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.2 -window .f - updateText + updateWidgets destroy .f .t index .f } -returnCodes error -result {bad text index ".f"} @@ -520,7 +508,7 @@ test textWind-5.2 {EmbWinStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.2 -window .f - updateText + updateWidgets destroy .f catch {.t index .f} list [.t bbox 1.2] [.t bbox 1.3] @@ -536,7 +524,7 @@ test textWind-5.3 {EmbWinStructureProc procedure} -setup { frame .f -width 10 -height 20 -bg $color .t window create 1.2 -align bottom .t window configure 1.2 -window .f - updateText + updateWidgets destroy .f .t index .f } -returnCodes error -result {bad text index ".f"} @@ -548,7 +536,7 @@ test textWind-5.4 {EmbWinStructureProc procedure} -setup { frame .f -width 10 -height 20 -bg $color .t window create 1.2 -align bottom .t window configure 1.2 -window .f - updateText + updateWidgets destroy .f catch {.t index .f} list [.t bbox 1.2] [.t bbox 1.3] @@ -562,10 +550,10 @@ test textWind-5.5 {EmbWinStructureProc procedure} -setup { } -body { .t insert 1.0 "Some sample text" .t window create 1.2 -create {frame .f -width 10 -height 20 -bg $color} - updateText + updateWidgets .t window configure 1.2 -create {frame .f -width 20 -height 10 -bg $color} destroy .f - updateText + updateWidgets list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3] } -result [list 0 1.2 \ [list [expr {$padx+2*$fixedWidth}] [expr {$pady+(($fixedHeight-10)/2)}] 20 10] \ @@ -599,9 +587,9 @@ test textWind-7.1 {EmbWinLostContentProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.2 -window .f - updateText + updateWidgets place .f -in .t -x 100 -y 50 - updateText + updateWidgets list [winfo geom .f] [.t bbox 1.2] } -cleanup { destroy .f @@ -616,9 +604,9 @@ test textWind-7.2 {EmbWinLostContentProc procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.2 -window .t.f - updateText + updateWidgets place .t.f -x 100 -y 50 - updateText + updateWidgets list [winfo geom .t.f] [.t bbox 1.2] } -cleanup { destroy .t.f @@ -678,7 +666,7 @@ test textWind-10.1 {EmbWinLayoutProc procedure} -setup { .t window create 1.5 -create { frame .f -width 10 -height 20 -bg $color } - updateText + updateWidgets list [winfo exists .f] [winfo width .f] [winfo height .f] [.t index .f] } -cleanup { destroy .f @@ -696,7 +684,7 @@ test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} -setup error "couldn't create window" } set msg xyzzy - updateText + updateWidgets list $msg [.t bbox 1.5] } -cleanup { rename bgerror {} @@ -716,7 +704,7 @@ test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} -setup concat gorp } set msg xyzzy - updateText + updateWidgets list $msg [.t bbox 1.5] } -cleanup { rename bgerror {} @@ -742,7 +730,7 @@ test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} -setup } set count 0 while {([llength $msg] < 2) && ($count < 100)} { - updateText + updateWidgets incr count .t bbox 1.5 after 10 @@ -772,7 +760,7 @@ test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -setup frame .t.f frame .t.f.f -width 10 -height 20 -bg $color } - updateText + updateWidgets lappend msg [winfo exists .t.f.f] } -cleanup { destroy .t.f @@ -789,12 +777,12 @@ test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} -setup } } -body { .t insert 1.0 "Some sample text" - updateText + updateWidgets .t window create 1.5 -create { concat .t } set msg {} - updateText + updateWidgets lappend msg [.t bbox 1.5] } -cleanup { rename bgerror {} @@ -840,9 +828,9 @@ test textWind-10.8 {EmbWinLayoutProc procedure, error in creating window} -setup concat .t2 } set msg {} - updateText + updateWidgets set i 0 - while {[llength $msg] == 1 && [incr i] < 200} { updateText } + while {[llength $msg] == 1 && [incr i] < 200} { updateWidgets } return $msg } -cleanup { destroy .t2 @@ -856,9 +844,9 @@ test textWind-10.9 {EmbWinLayoutProc procedure, steal window from self} -setup { .t insert 1.0 ABCDEFGHIJKLMNOP button .t.b -text "Hello!" .t window create 1.5 -window .t.b - updateText + updateWidgets .t window create 1.3 -create {concat .t.b} - updateText + updateWidgets .t index .t.b } -cleanup { destroy .t.b @@ -887,7 +875,7 @@ test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth}] -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateText + updateWidgets list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -903,7 +891,7 @@ test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth+1}] -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateText + updateWidgets list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -919,7 +907,7 @@ test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateText + updateWidgets list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -935,7 +923,7 @@ test textWind-10.14 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 220 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateText + updateWidgets list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -951,7 +939,7 @@ test textWind-10.15 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width 250 -height 220 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateText + updateWidgets list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -965,14 +953,14 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup { place forget .t pack .t # Make sure the Text is mapped before we start - updateText + updateWidgets } -body { .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - updateText + updateWidgets winfo geom .f } -cleanup { destroy .f @@ -985,14 +973,14 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup { place forget .t pack .t # Make sure the Text is mapped before we start - updateText + updateWidgets } -body { .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 frame .t.f -width 30 -height 20 -bg $color .t window create 1.12 -window .t.f - updateText + updateWidgets winfo geom .t.f } -cleanup { destroy .t.f @@ -1006,17 +994,17 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -se place forget .t pack .t # Make sure the Text is mapped before we start - updateText + updateWidgets } -body { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - updateText + updateWidgets bind .f {set x ".f configured"} set x {no configures} .t delete 1.0 .t insert 1.0 "X" - updateText + updateWidgets return $x } -cleanup { destroy .f @@ -1038,7 +1026,7 @@ test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} -setup { .t insert end " with junk after it." .t xview moveto 0 .t xview scroll 5 units - updateText + updateWidgets list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] [winfo ismapped .f2] } -cleanup { destroy .f .f2 @@ -1059,10 +1047,10 @@ test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} -setup { frame .f2 -width 40 -height 10 -bg $color .t window create end -window .f2 .t insert end " with junk after it." - updateText + updateWidgets .t xview moveto 0 .t xview scroll 25 units - updateText + updateWidgets list [winfo ismapped .f] [winfo ismapped .f2] [winfo geom .f2] [.t bbox .f2] } -cleanup { destroy .f .f2 @@ -1081,19 +1069,19 @@ test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} -setup { bind .f {lappend x mapped} bind .f {lappend x unmapped} set x created - updateText + updateWidgets lappend x modified .t delete 1.0 - updateText + updateWidgets lappend x replaced .t window configure .f -window {} .t delete 1.1 .t window create 1.4 -window .f - updateText + updateWidgets lappend x off-screen .t configure -wrap none .t insert 1.0 "Enough text to make the line run off-screen" - updateText + updateWidgets return $x } -cleanup { destroy .f @@ -1107,7 +1095,7 @@ test textWind-13.1 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align top -padx 2 -pady 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1122,7 +1110,7 @@ test textWind-13.2 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1137,7 +1125,7 @@ test textWind-13.3 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1152,7 +1140,7 @@ test textWind-13.4 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1167,7 +1155,7 @@ test textWind-13.5 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align top -padx 2 -pady 1 -stretch 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1182,7 +1170,7 @@ test textWind-13.6 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 -stretch 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1197,7 +1185,7 @@ test textWind-13.7 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 -stretch 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1212,7 +1200,7 @@ test textWind-13.8 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 -stretch 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1229,7 +1217,7 @@ test textWind-13.9 {EmbWinBboxProc procedure, spacing options} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 - updateText + updateWidgets list [winfo geom .f] [.t bbox .f] } -cleanup { .t configure -spacing1 0 -spacing3 0 @@ -1246,14 +1234,14 @@ test textWind-14.1 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f - updateText + updateWidgets bind .f {lappend x unmapped} set x modified .t insert 1.0 x lappend x removed .t window configure .f -window {} lappend x updated - updateText + updateWidgets return $x } -cleanup { destroy .f @@ -1266,14 +1254,14 @@ test textWind-14.2 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f - updateText + updateWidgets bind .f {lappend x unmapped} set x modified .t insert 1.0 x lappend x deleted .t delete .f lappend x updated - updateText + updateWidgets return $x } -cleanup { destroy .f @@ -1286,10 +1274,10 @@ test textWind-14.3 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f - updateText + updateWidgets .t yview 2.0 set result [winfo ismapped .f] - updateText ; after 10 + updateWidgets ; after 10 list $result [winfo ismapped .f] } -cleanup { destroy .f @@ -1302,10 +1290,10 @@ test textWind-14.4 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9" frame .t.f -width 30 -height 20 -bg $color .t window create 1.2 -window .t.f - updateText + updateWidgets .t yview 2.0 set result [winfo ismapped .t.f] - updateText + updateWidgets list $result [winfo ismapped .t.f] } -cleanup { destroy .t.f @@ -1343,9 +1331,9 @@ test textWind-16.1 {EmbWinTextStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f - updateText + updateWidgets pack forget .t - updateText + updateWidgets winfo ismapped .f } -cleanup { pack .t @@ -1360,12 +1348,12 @@ test textWind-16.2 {EmbWinTextStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f - updateText + updateWidgets set result {} lappend result [winfo geom .f] [.t bbox .f] frame .f2 -width 150 -height 30 -bd 2 -relief raised pack .f2 -before .t - updateText + updateWidgets lappend result [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f .f2 @@ -1381,9 +1369,9 @@ test textWind-16.3 {EmbWinTextStructureProc procedure} -setup { .t configure -wrap none .t insert 1.0 "Some sample text" .t window create 1.6 - updateText + updateWidgets pack forget .t - updateText + updateWidgets } -cleanup { pack .t } -result {} @@ -1396,9 +1384,9 @@ test textWind-16.4 {EmbWinTextStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 30 -height 20 -bg $color .t window create 1.6 -window .t.f - updateText + updateWidgets pack forget .t - updateText + updateWidgets list [winfo ismapped .t.f] [.t bbox .t.f] } -cleanup { pack .t @@ -1414,7 +1402,7 @@ test textWind-17.1 {peer widgets and embedded windows} -setup { .t window create 1.3 -window .f toplevel .tt pack [.t peer create .tt.t] - updateText + updateWidgets destroy .t .tt winfo exists .f } -result {0} @@ -1428,10 +1416,10 @@ test textWind-17.2 {peer widgets and embedded windows} -setup { .t window create 1.4 -window .f toplevel .tt pack [.t peer create .tt.t] - updateText + updateWidgets destroy .t .tt.t insert 1.0 "foo" - updateText + updateWidgets destroy .tt } -result {} @@ -1443,9 +1431,9 @@ test textWind-17.3 {peer widget and -create} -setup { .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] - updateText + updateWidgets .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateText + updateWidgets destroy .t .tt } -result {} @@ -1459,10 +1447,10 @@ test textWind-17.4 {peer widget deleted one window shouldn't delete others} -set toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateText + updateWidgets destroy .tt lappend res [.t get 1.2] - updateText + updateWidgets lappend res [.t get 1.2] } -cleanup { destroy .t @@ -1477,7 +1465,7 @@ test textWind-17.5 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateText + updateWidgets list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1492,7 +1480,7 @@ test textWind-17.6 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateText + updateWidgets list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { @@ -1508,7 +1496,7 @@ test textWind-17.7 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateText + updateWidgets list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1523,7 +1511,7 @@ test textWind-17.8 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateText + updateWidgets list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { @@ -1539,7 +1527,7 @@ test textWind-17.9 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateText + updateWidgets .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red] list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window] } -cleanup { @@ -1555,9 +1543,9 @@ test textWind-17.10 {peer widget window configuration} -setup { .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] - updateText + updateWidgets .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateText + updateWidgets # There is a blue window in the main widget .t but not in the peer .tt.t lappend res [.t window cget 1.2 -window] lappend res [.tt.t window cget 1.2 -window] @@ -1565,7 +1553,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # inserted in .t at index 1.2 will now be found in .t at index 1.3 # The underlying linked segments are common in a text widget and its peers. .tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -bg green] - updateText + updateWidgets lappend res [.t window cget 1.2 -window] lappend res [.t window cget 1.3 -window] # In the peer, the green window still is at 1.2, and there is no window at 1.3 @@ -1576,7 +1564,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # the embedded window found at index 1.2 in .t is the one originally at 1.2 in .t, i.e. # the blue one .t window configure 1.2 -create {destroy %W.f ; update ; frame %W.f -width 50 -height 7 -bg red} - updateText + updateWidgets # The main widget .t still has a window named .t.f at 1.2. This is NOT the blue # frame but the red frame from the -create script, which bears the same name. lappend res [.t window cget 1.2 -window] @@ -1585,7 +1573,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # When removing the -window option the create script plays, therefore .t still has # the red frame .t.f at 1.2 .t window configure 1.2 -window {} - updateText + updateWidgets lappend res [.t window cget 1.2 -window] # The -create script associated to index 1.2 applies to all peers (that's the reason # why the manual states that "If multiple peer widgets are in use, it is usually simpler @@ -1593,7 +1581,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # when removing the -window option in the peer, the -create script is run, which replaces # the green frame by the red one named as per the -create script, i.e. .tt.t.f .tt.t window configure 1.2 -window {} - updateText + updateWidgets lappend res [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1607,12 +1595,12 @@ test textWind-18.1 {embedded window deletion triggered by a script bound to {.t delete .f} - updateText + updateWidgets # this shall not crash (bug 1501749) after 100 {.t yview end} tkwait visibility .f2 after 200 - updateText + updateWidgets } -cleanup { destroy .t .f .f2 } -result {} @@ -1624,7 +1612,7 @@ test textWind-18.2 {text widget deletion triggered by a script bound to embedded for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} .t window create end -window [frame .f -background red -width 80 -height 80] bind .f {destroy .t} - updateText + updateWidgets # this shall not crash (bug 1501749) after 100 {.t yview end} tkwait window .t @@ -1642,7 +1630,7 @@ test textWind-18.3 {embedded window destruction in cascade} -setup { bind .t.b1 {destroy .t.b2 ; set x 1} button .t.b2 .t window create 2.0 -window .t.b2 - updateText + updateWidgets # this shall not crash (bug 54fe7a5e71) after 100 {.t delete 1.0 end} tkwait variable x -- cgit v0.12 From 5ecce42c072918cdc8bc8197dd8fec59464e5555 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 08:07:33 +0000 Subject: Stabilize textWind-12.1. This test was observed once to error out (bad window path name '.f' triggerd on '.t window create 1.4 -window .f') at GitHub Actions, in branch unstable_tests, on macOS, with xcode (deployment target). Ensure the deletion '.t window configure .f -window {} ; .t delete 1.1' is over before running '.t window create 1.4 -window .f'. --- tests/textWind.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/textWind.test b/tests/textWind.test index 6a3862c..9de2eb8 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -1076,6 +1076,7 @@ test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} -setup { lappend x replaced .t window configure .f -window {} .t delete 1.1 + updateWidgets .t window create 1.4 -window .f updateWidgets lappend x off-screen -- cgit v0.12 From 2aa86905d9177731a46892a3c06d2590be66f624 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 09:48:37 +0000 Subject: Fix indentation in textImage.test --- tests/textImage.test | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/textImage.test b/tests/textImage.test index 2666ec5..2f60211 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -389,15 +389,15 @@ test textImage-4.2 {alignment checking - baseline} -setup { # Sizes larger than 25 can be too big and lead to a negative 'norm', # at least on Windows XP with certain settings. foreach size {10 15 20 25} { - font configure test_font2 -size $size - array set Metrics [font metrics test_font2] - update - foreach {x y w h} [.t bbox small] {} - set norm [expr { - (([image height large] - $Metrics(-linespace))/2 - + $Metrics(-ascent) - [image height small] - $y) + font configure test_font2 -size $size + array set Metrics [font metrics test_font2] + update + foreach {x y w h} [.t bbox small] {} + set norm [expr { + (([image height large] - $Metrics(-linespace))/2 + + $Metrics(-ascent) - [image height small] - $y) }] - lappend result "$size $norm" + lappend result "$size $norm" } return $result } -cleanup { -- cgit v0.12 From 146fb4a7da17bd38d1496015d3e9a374ca243f18 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 11:38:20 +0000 Subject: Oops. textWind-11.[1-3] need plain update to make sure the widget is initially mapped. Also, add more checks in some other textWind tests. --- tests/textWind.test | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index 9de2eb8..a0fc6cb 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -355,12 +355,13 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f updateWidgets + set res [winfo ismapped .f] .t window configure 1.3 -window {} updateWidgets - list [winfo ismapped .f] [.t bbox 1.4] + lappend res [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f -} -result [list 0 \ +} -result [list 1 0 \ [list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]] test textWind-3.4 {EmbWinConfigure procedure} -setup { @@ -384,12 +385,13 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f updateWidgets + set res [winfo ismapped .t.f] .t window configure 1.3 -window {} updateWidgets - list [winfo ismapped .t.f] [.t bbox 1.4] + lappend res [winfo ismapped .t.f] [.t bbox 1.4] } -cleanup { destroy .t.f -} -result [list 0 \ +} -result [list 1 0 \ [list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]] test textWind-3.6 {EmbWinConfigure procedure} -setup { @@ -953,11 +955,12 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup { place forget .t pack .t # Make sure the Text is mapped before we start - updateWidgets + update } -body { .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 + update frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f updateWidgets @@ -973,11 +976,12 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup { place forget .t pack .t # Make sure the Text is mapped before we start - updateWidgets + update } -body { .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 + update frame .t.f -width 30 -height 20 -bg $color .t window create 1.12 -window .t.f updateWidgets @@ -994,7 +998,7 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -se place forget .t pack .t # Make sure the Text is mapped before we start - updateWidgets + update } -body { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color -- cgit v0.12 From f5f6714eca4136a545b786e27d2c239120e638a5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 15:36:22 +0000 Subject: Further stabilize textWind-3.* since [5050b5e9] did not reach the goal: on macOS, textWind-3.3, -3.4 and -3.5 could still fail. --- tests/textWind.test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/textWind.test b/tests/textWind.test index a0fc6cb..c96951c 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -338,6 +338,7 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" + update frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f updateWidgets @@ -352,6 +353,7 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" + update frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f updateWidgets @@ -368,6 +370,7 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { destroy .t.f } -body { .t insert 1.0 "Some sample text" + update frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f updateWidgets @@ -382,6 +385,7 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { destroy .t.f } -body { .t insert 1.0 "Some sample text" + update frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f updateWidgets @@ -398,6 +402,7 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" + update frame .f -width 10 -height 20 -bg $color .t window create 1.3 updateWidgets @@ -413,6 +418,7 @@ test textWind-3.7 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" + update frame .f frame .f.f -width 15 -height 20 -bg $color pack .f.f @@ -424,6 +430,7 @@ test textWind-3.8 {EmbWinConfigure procedure} -setup { destroy .t2 } -body { .t insert 1.0 "Some sample text" + update toplevel .t2 -width 20 -height 10 -bg $color .t window create 1.3 .t window configure 1.3 -window .t2 @@ -434,6 +441,7 @@ test textWind-3.9 {EmbWinConfigure procedure} -setup { destroy .t2 } -body { .t insert 1.0 "Some sample text" + update toplevel .t2 -width 20 -height 10 -bg $color .t window create 1.3 catch {.t window configure 1.3 -window .t2} @@ -445,6 +453,7 @@ test textWind-3.10 {EmbWinConfigure procedure} -setup { .t delete 1.0 end } -body { .t insert 1.0 "Some sample text" + update .t window create 1.3 .t window configure 1.3 -window .t } -returnCodes error -result {can't embed .t in .t} @@ -454,6 +463,7 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { # This test checks for various errors when the text claims # a window away from itself. .t insert 1.0 "Some sample text" + update button .t.b -text "Hello!" .t window create 1.4 -window .t.b .t window create 1.6 -window .t.b -- cgit v0.12 From 1861e8412d565c4b61b91437c69129745800f819 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 17:19:20 +0000 Subject: Further stabilize panedwindow-23.30 since [022d2c75] was still not 100% enough. This test was found to fail once on macOS with xcode, and when this happened panedwindow-23.29 failed as well (therefore, apply the same stabilization to this latter test). --- tests/panedwindow.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 4ffcbe2..c2b0774 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4922,7 +4922,7 @@ test panedwindow-23.29 {ConfigurePanes, -hide works} -setup { lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] [winfo width .p] .p paneconfigure .f2 -hide 1 - update + update ; after 100 ; update lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ @@ -4951,7 +4951,7 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] [winfo width .p] .p paneconfigure .f2 -hide 1 - update + update ; after 100 ; update lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ -- cgit v0.12 From b11f62d364e59f4482c917db7a439a134db67f21 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 19:00:35 +0000 Subject: Further stabilize unixEmbed-11.2 since [501b0a7b] was still not 100% enough. This test was found to fail once more on macOS with clang (mem, --enable-aqua). --- tests/unixEmbed.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 9cd54c8..8c3492d 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1299,8 +1299,8 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { toplevel .embed -use [winfo id .main.f] -bg green pack [button .embed.b -text "Emb Button" \ -command {lappend result ".embed.b"}] -padx 30 -pady 30 - updateWidgets update + updateWidgets focus -force .main after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] -- cgit v0.12 From 4a492ded7d28b278d05b90bec13c063918a4648e Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 19:22:49 +0000 Subject: Stabilize textImage-4.2. This test was observed failing several times at GitHub Actions, on macOS with clang (no, --enable-aqua) or clang (mem, --enable-aqua). Font configuration schedules a redraw at idle time, that must be over before the bbox of the 'small' image is requested. --- tests/textImage.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/textImage.test b/tests/textImage.test index 2f60211..1676348 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -391,7 +391,7 @@ test textImage-4.2 {alignment checking - baseline} -setup { foreach size {10 15 20 25} { font configure test_font2 -size $size array set Metrics [font metrics test_font2] - update + update ; after 100 ; update idletasks foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From 68d2ec894e6d8f8ec70cd71893fde8bc342097cd Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 Apr 2022 19:37:35 +0000 Subject: Stabilize notebook-6.1 and notebook-6.7. These tests were observed failing a few times on macOS with either clang or xcode. Adding 'update idletasks' after hiding or forgetting a notebook tab should help when using the resulting 'ismapped' output. --- tests/ttk/notebook.test | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index e58812a..d0856f0 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -156,8 +156,9 @@ test notebook-6.1 "Hide selected tab" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb hide $nb.f2 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] - update idletasks; lappend result [winfo ismapped $nb.f3] + lappend result [winfo ismapped $nb.f3] } -result [list 1 1 2 0 1] # See 1370833 @@ -187,6 +188,7 @@ test notebook-6.3 "Hide first tab when it's the current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f1] $nb hide $nb.f1 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f1] } -result [list 0 1 1 0] @@ -202,6 +204,7 @@ test notebook-6.4 "Forget first tab when it's the current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f1] $nb forget $nb.f1 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f1] } -result [list 0 1 0 0] @@ -217,6 +220,7 @@ test notebook-6.5 "Hide last tab when it's the current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f3] $nb hide $nb.f3 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f3] } -result [list 2 1 1 0] @@ -232,6 +236,7 @@ test notebook-6.6 "Forget a middle tab when it's the current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb forget $nb.f2 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] } -result [list 1 1 1 0] @@ -247,6 +252,7 @@ test notebook-6.7 "Hide a middle tab when it's the current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb hide $nb.f2 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] } -result [list 1 1 2 0] @@ -262,6 +268,7 @@ test notebook-6.8 "Forget a non-current tab < current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb forget $nb.f1 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] } -result [list 1 1 0 1] @@ -277,6 +284,7 @@ test notebook-6.9 "Hide a non-current tab < current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb hide $nb.f1 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] } -result [list 1 1 1 1] @@ -292,6 +300,7 @@ test notebook-6.10 "Forget a non-current tab > current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb forget $nb.f3 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] } -result [list 1 1 1 1] @@ -307,6 +316,7 @@ test notebook-6.11 "Hide a non-current tab > current" -setup { set result [list] lappend result [$nb index current] [winfo ismapped $nb.f2] $nb hide $nb.f3 + update idletasks lappend result [$nb index current] [winfo ismapped $nb.f2] } -result [list 1 1 1 1] @@ -322,8 +332,10 @@ test notebook-6.12 "Hide and re-add a tab" -setup { set result [list] lappend result [$nb index current] [$nb tab $nb.f2 -state] $nb hide $nb.f2 + update idletasks lappend result [$nb index current] [$nb tab $nb.f2 -state] $nb add $nb.f2 + update idletasks lappend result [$nb index current] [$nb tab $nb.f2 -state] } -result [list 1 normal 2 hidden 2 normal] -- cgit v0.12 From 2425c553c557b7ef6506e13814576177519c15da Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 1 May 2022 15:07:29 +0000 Subject: Revert [e17046c5] since it does not fix instabilities in textWind-3.* on macOS, and try something else for these tests. --- tests/textWind.test | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index c96951c..c4ec601 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -338,12 +338,11 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" - update frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateWidgets + updateWidgets ; after 10 ; updateWidgets .t window configure 1.3 -window {} - updateWidgets + updateWidgets ; after 10 ; updateWidgets .t index .f } -cleanup { destroy .f @@ -353,13 +352,12 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" - update frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateWidgets + updateWidgets ; after 10 ; updateWidgets set res [winfo ismapped .f] .t window configure 1.3 -window {} - updateWidgets + updateWidgets ; after 10 ; updateWidgets lappend res [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -370,12 +368,11 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { destroy .t.f } -body { .t insert 1.0 "Some sample text" - update frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateWidgets + updateWidgets ; after 10 ; updateWidgets .t window configure 1.3 -window {} - updateWidgets + updateWidgets ; after 10 ; updateWidgets .t index .t.f } -cleanup { destroy .t.f @@ -385,13 +382,12 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { destroy .t.f } -body { .t insert 1.0 "Some sample text" - update frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateWidgets + updateWidgets ; after 10 ; updateWidgets set res [winfo ismapped .t.f] .t window configure 1.3 -window {} - updateWidgets + updateWidgets ; after 10 ; updateWidgets lappend res [winfo ismapped .t.f] [.t bbox 1.4] } -cleanup { destroy .t.f @@ -402,12 +398,11 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" - update frame .f -width 10 -height 20 -bg $color .t window create 1.3 - updateWidgets + updateWidgets ; after 10 ; updateWidgets .t window configure 1.3 -window .f - updateWidgets + updateWidgets ; after 10 ; updateWidgets list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -418,7 +413,6 @@ test textWind-3.7 {EmbWinConfigure procedure} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" - update frame .f frame .f.f -width 15 -height 20 -bg $color pack .f.f @@ -426,22 +420,22 @@ test textWind-3.7 {EmbWinConfigure procedure} -setup { } -cleanup { destroy .f } -returnCodes error -result {can't embed .f.f in .t} + test textWind-3.8 {EmbWinConfigure procedure} -setup { destroy .t2 } -body { .t insert 1.0 "Some sample text" - update toplevel .t2 -width 20 -height 10 -bg $color .t window create 1.3 .t window configure 1.3 -window .t2 } -cleanup { destroy .t2 } -returnCodes error -result {can't embed .t2 in .t} + test textWind-3.9 {EmbWinConfigure procedure} -setup { destroy .t2 } -body { .t insert 1.0 "Some sample text" - update toplevel .t2 -width 20 -height 10 -bg $color .t window create 1.3 catch {.t window configure 1.3 -window .t2} @@ -449,21 +443,21 @@ test textWind-3.9 {EmbWinConfigure procedure} -setup { } -cleanup { destroy .t2 } -result {-window {} {} {} {}} + test textWind-3.10 {EmbWinConfigure procedure} -setup { .t delete 1.0 end } -body { .t insert 1.0 "Some sample text" - update .t window create 1.3 .t window configure 1.3 -window .t } -returnCodes error -result {can't embed .t in .t} + test textWind-3.11 {EmbWinConfigure procedure} -setup { .t delete 1.0 end } -body { # This test checks for various errors when the text claims # a window away from itself. .t insert 1.0 "Some sample text" - update button .t.b -text "Hello!" .t window create 1.4 -window .t.b .t window create 1.6 -window .t.b -- cgit v0.12 From 40e732427a9ce72d1e094ff65e049d5853ec1da3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 1 May 2022 15:12:57 +0000 Subject: Further stabilize panedwindow-23.30 since [27e2d762] and [022d2c75] were yet not 100% enough. This test was found to fail once more on macOS with clang (no, --enable-aqua). --- tests/panedwindow.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index c2b0774..7e192cf 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4940,11 +4940,11 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { frame .f4 -width 40 -bg green .p add .f1 .f2 .f3 .f4 pack .p - update - # On macOS, the above update does the job of mapping .p and its children + updateWidgets + # On macOS, the above updateWidgets does the job of mapping .p and its children # but then getting the correct mapping state (0) of .f4 needs another - # update because .f4 does not fit in the width of .p - update + # updateWidgets because .f4 does not fit in the width of .p + updateWidgets set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] -- cgit v0.12 From efa761316fc2b262d02794c9264e4aa3a0edb891 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 10 Jun 2022 20:38:39 +0000 Subject: Further stabilize textWind-3.* since [e17046c5] did not reach the goal: on macOS, textWind-3.3, -3.4 and -3.5 could still fail. In fact, in the current state of affairs these tests MUST reliably fail on the mac because of the not yet fixed bug [61e0bb8aab]. Achieve this now. --- tests/textWind.test | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index c4ec601..7581af0 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -324,6 +324,22 @@ test textWind-2.25 {TkTextWindowCmd procedure, "names" option} -setup { } -result {.f .f2 .t.f .t.f2} +proc waitForMap {w} { + set count 0 + while {$count < 10 && ![winfo ismapped $w]} { + updateWidgets + incr count + after 50 + } +} +proc waitForUnmap {w} { + set count 0 + while {$count < 10 && [winfo ismapped $w]} { + updateWidgets + incr count + after 50 + } +} test textWind-3.1 {EmbWinConfigure procedure} -setup { destroy .f } -body { @@ -340,9 +356,9 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateWidgets ; after 10 ; updateWidgets + waitForMap .f .t window configure 1.3 -window {} - updateWidgets ; after 10 ; updateWidgets + waitForUnmap .f .t index .f } -cleanup { destroy .f @@ -354,10 +370,10 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateWidgets ; after 10 ; updateWidgets + waitForMap .f set res [winfo ismapped .f] .t window configure 1.3 -window {} - updateWidgets ; after 10 ; updateWidgets + waitForUnmap .f lappend res [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -370,9 +386,9 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateWidgets ; after 10 ; updateWidgets + waitForMap .t.f .t window configure 1.3 -window {} - updateWidgets ; after 10 ; updateWidgets + waitForUnmap .t.f .t index .t.f } -cleanup { destroy .t.f @@ -384,10 +400,10 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateWidgets ; after 10 ; updateWidgets + waitForMap .t.f set res [winfo ismapped .t.f] .t window configure 1.3 -window {} - updateWidgets ; after 10 ; updateWidgets + waitForUnmap .t.f lappend res [winfo ismapped .t.f] [.t bbox 1.4] } -cleanup { destroy .t.f @@ -400,9 +416,9 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 - updateWidgets ; after 10 ; updateWidgets + updateWidgets .t window configure 1.3 -window .f - updateWidgets ; after 10 ; updateWidgets + waitForMap .f list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -461,9 +477,11 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { button .t.b -text "Hello!" .t window create 1.4 -window .t.b .t window create 1.6 -window .t.b - updateWidgets + waitForMap .t.b .t index .t.b } -result {1.6} +rename waiForMap {} +rename waiForUnmap {} .t delete 1.0 end -- cgit v0.12 From a0e7d5e8ba3e5b49989a5049ae4ea2e515018acc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 11 Jun 2022 17:27:36 +0000 Subject: Fix typo --- tests/textWind.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index 7581af0..21e38f1 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -480,8 +480,8 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { waitForMap .t.b .t index .t.b } -result {1.6} -rename waiForMap {} -rename waiForUnmap {} +rename waitForMap {} +rename waitForUnmap {} .t delete 1.0 end -- cgit v0.12 From 36cf0d0e753c2775b2a11f51dd661ae29ffc66cc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 12 Jun 2022 10:38:56 +0000 Subject: Further stabilize unixEmbed-11.2 since [ac772463] was still not enough. This test was found to fail once more at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). --- tests/constraints.tcl | 19 +++++++++++++++++++ tests/textWind.test | 18 ------------------ tests/unixEmbed.test | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index e306898..41a17c2 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -244,6 +244,25 @@ namespace eval tk { } } + namespace export waitForMap waitForUnmap + # Procedures waiting for a window to be mapped or unmapped, with timeout + proc waitForMap {w} { + set count 0 + while {$count < 10 && ![winfo ismapped $w]} { + updateWidgets + incr count + after 50 + } + } + proc waitForUnmap {w} { + set count 0 + while {$count < 10 && [winfo ismapped $w]} { + updateWidgets + incr count + after 50 + } + } + } } diff --git a/tests/textWind.test b/tests/textWind.test index 21e38f1..0273469 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -324,22 +324,6 @@ test textWind-2.25 {TkTextWindowCmd procedure, "names" option} -setup { } -result {.f .f2 .t.f .t.f2} -proc waitForMap {w} { - set count 0 - while {$count < 10 && ![winfo ismapped $w]} { - updateWidgets - incr count - after 50 - } -} -proc waitForUnmap {w} { - set count 0 - while {$count < 10 && [winfo ismapped $w]} { - updateWidgets - incr count - after 50 - } -} test textWind-3.1 {EmbWinConfigure procedure} -setup { destroy .f } -body { @@ -480,8 +464,6 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { waitForMap .t.b .t index .t.b } -result {1.6} -rename waitForMap {} -rename waitForUnmap {} .t delete 1.0 end diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 8c3492d..e0d3015 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1300,7 +1300,7 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { pack [button .embed.b -text "Emb Button" \ -command {lappend result ".embed.b"}] -padx 30 -pady 30 update - updateWidgets + waitForMap .embed.b focus -force .main after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] -- cgit v0.12 From b8691d151cbe257cb1ee0f00e84b9b397a6a3f4f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 12 Jun 2022 10:49:20 +0000 Subject: Stabilize unixEmbed-5.*. Test unixEmbed-5.1a was found to fail once at least, at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). --- tests/unixEmbed.test | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index e0d3015..986dc6a 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -722,6 +722,7 @@ test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} -constraints { } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 + update dobg "set w1 [winfo id .f1]" dobg { eval destroy [winfo child .] @@ -746,6 +747,7 @@ test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints { } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 + update child alias w1 winfo id .f1 child eval { destroy [winfo child .] @@ -769,6 +771,7 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constrai } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 + update dobg "set w1 [winfo id .f1]" dobg { eval destroy [winfo child .] @@ -794,6 +797,7 @@ test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constra } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 + update child alias w1 winfo id .f1 child eval { destroy [winfo child .] @@ -815,6 +819,7 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints { } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 + update dobg "set w1 [winfo id .f1]" dobg { eval destroy [winfo child .] @@ -842,6 +847,7 @@ test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints { } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 + update child alias w1 winfo id .f1 child eval { destroy [winfo child .] -- cgit v0.12 From 4dfb05e581b4f56f9faaa69963ee9a0dbbb83c92 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 12 Jun 2022 11:40:28 +0000 Subject: Constrain textWind-3.2, -3.3, -3.4 and -3.5 with aquaKnownBug until the fix for ticket [61e0bb8aab] gets merged. --- tests/constraints.tcl | 3 +++ tests/textWind.test | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 41a17c2..56259e7 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -286,6 +286,9 @@ testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)] testConstraint noExceed [expr { ![testConstraint unix] || [catch {font actual "\{xyz"}] }] +# constraint for running a test on all windowing system except aqua +# where the test fails due to a known bug +testConstraint aquaKnownBug [expr {[testConstraint notAqua] || [testConstraint knownBug]}] # constraints for testing facilities defined in the tktest executable... testConstraint testImageType [expr {"test" in [image types]}] diff --git a/tests/textWind.test b/tests/textWind.test index 0273469..ef33b30 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -334,7 +334,9 @@ test textWind-3.1 {EmbWinConfigure procedure} -setup { destroy .f } -returnCodes error -result {unknown option "-foo"} -test textWind-3.2 {EmbWinConfigure procedure} -setup { +# The next 4 tests are constrained by aquaKnownBug until the fix for ticket +# [61e0bb8aab] gets merged +test textWind-3.2 {EmbWinConfigure procedure} -constraints {aquaKnownBug} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" @@ -348,7 +350,7 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { destroy .f } -returnCodes error -result {bad text index ".f"} -test textWind-3.3 {EmbWinConfigure procedure} -setup { +test textWind-3.3 {EmbWinConfigure procedure} -constraints {aquaKnownBug} -setup { destroy .f } -body { .t insert 1.0 "Some sample text" @@ -364,7 +366,7 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { } -result [list 1 0 \ [list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]] -test textWind-3.4 {EmbWinConfigure procedure} -setup { +test textWind-3.4 {EmbWinConfigure procedure} -constraints {aquaKnownBug} -setup { destroy .t.f } -body { .t insert 1.0 "Some sample text" @@ -378,7 +380,7 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { destroy .t.f } -returnCodes error -result {bad text index ".t.f"} -test textWind-3.5 {EmbWinConfigure procedure} -setup { +test textWind-3.5 {EmbWinConfigure procedure} -constraints {aquaKnownBug} -setup { destroy .t.f } -body { .t insert 1.0 "Some sample text" -- cgit v0.12 From 20414a9b1346f970a3d55194c5f2513d47a6bb08 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 15 Jun 2022 06:05:46 +0000 Subject: Simplify frame-3.10 and frame-12.3 (the latter is failing sporadically). This is no stability fix though. --- tests/frame.test | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index 63bb187..2acf869 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -673,19 +673,11 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 - if {[tk windowingsystem] eq "aqua"} { - update idletasks - } else { - update - } + updateWidgets option add *x.use [winfo id .t] toplevel .x -width 140 -height 300 -bg green - if {[tk windowingsystem] eq "aqua"} { - update idletasks - } else { - tkwait visibility .x - update - } + tkwait visibility .x + updateWidgets list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] @@ -1169,19 +1161,11 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { labelframe .f -font myfont -text Mupp place .f -x 0 -y 0 -width 40 -height 40 pack [frame .f.f] -fill both -expand 1 - if {[tk windowingsystem] eq "aqua"} { - update idletasks - } else { - update - } + updateWidgets set h1 [font metrics myfont -linespace] set y1 [winfo y .f.f] font configure myfont -size 20 - if {[tk windowingsystem] eq "aqua"} { - update idletasks - } else { - update - } + updateWidgets set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] expr {($h2 - $h1) - ($y2 - $y1)} -- cgit v0.12 From bfc1d5e2f8d755d89bb17f89d36de379f8c9e24d Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 15 Jun 2022 17:47:02 +0000 Subject: Restore what was working before previous commit. --- tests/frame.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/frame.test b/tests/frame.test index 2acf869..84d6b7d 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -676,7 +676,9 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { updateWidgets option add *x.use [winfo id .t] toplevel .x -width 140 -height 300 -bg green - tkwait visibility .x + if {[tk windowingsystem] ne "aqua"} { + tkwait visibility .x + } updateWidgets list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ -- cgit v0.12 From 798a1e8ff482d34a90363209b97249e6b8615609 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 18 Jun 2022 07:22:25 +0000 Subject: Further ruggedize unixEmbed-11.2 since after [768fe936] it failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). Error was: ---- errorInfo: bad window path name ".embed.b" while executing "winfo ismapped $w" (procedure "waitForMap" line 3) invoked from within "waitForMap .embed.b" ("uplevel" body line 11) invoked from within "uplevel 1 $script" ---- errorCode: TK LOOKUP WINDOW .embed.b --- tests/constraints.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 56259e7..d9461c0 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -248,7 +248,7 @@ namespace eval tk { # Procedures waiting for a window to be mapped or unmapped, with timeout proc waitForMap {w} { set count 0 - while {$count < 10 && ![winfo ismapped $w]} { + while {$count < 10 && (![winfo exists $w] || ![winfo ismapped $w])} { updateWidgets incr count after 50 -- cgit v0.12 From 40e4956a61ebe3f7fd19ae271d10d74e0ad2abf9 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 18 Jun 2022 08:07:08 +0000 Subject: Further ruggedize panedwindow-23.30 since after [27e2d762] it failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). --- tests/panedwindow.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 7e192cf..eb8a29a 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4942,9 +4942,9 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { pack .p updateWidgets # On macOS, the above updateWidgets does the job of mapping .p and its children - # but then getting the correct mapping state (0) of .f4 needs another + # but then getting the correct mapping state (0) of .f4 needs further # updateWidgets because .f4 does not fit in the width of .p - updateWidgets + waitForMap .f4 set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] -- cgit v0.12 From d38d35f4f5547eb00de798acbc092f1f0bbcb0f3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 18 Jun 2022 15:17:07 +0000 Subject: Stabilize textImage-3.2 since after [ecc939fd] it failed once at GitHub Actions in branch unstable_tests on macOS with xcode. What we really need is that the returned bbox be up-to-date at each of the loop steps, i.e. the line heights must have been recomputed, and this can be obtained by calling '.t sync' rather than calling 'update idletasks' after some delay. --- tests/textImage.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/textImage.test b/tests/textImage.test index 1676348..9de9864 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -391,7 +391,7 @@ test textImage-4.2 {alignment checking - baseline} -setup { foreach size {10 15 20 25} { font configure test_font2 -size $size array set Metrics [font metrics test_font2] - update ; after 100 ; update idletasks + update ; .t sync foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From 25c43cd6a37ec36d3140b22c8cace2a94a630b34 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 19 Jun 2022 19:27:47 +0000 Subject: Add debug output since unixEmbed-11.2 still failed once at GitHub Actions on macOS with clang (mem, --enable-aqua). --- tests/constraints.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index d9461c0..b931afb 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -253,6 +253,9 @@ namespace eval tk { incr count after 50 } + if {$count > 9} { + puts "waitForMap $w: timeout!" + } } proc waitForUnmap {w} { set count 0 @@ -261,6 +264,9 @@ namespace eval tk { incr count after 50 } + if {$count > 9} { + puts "waitForUnmap $w: timeout!" + } } } -- cgit v0.12 From 9293dfab6ff51ecca1ff680db992a93709519b43 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 20 Jun 2022 19:14:07 +0000 Subject: Further ruggedize panedwindow-23.30 since [fe28ce65] was just plain wrong and the test failed once at GitHub Actions in branch unstable_tests on macOS with clang (no, --enable-aqua). --- tests/panedwindow.test | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index eb8a29a..f02858d 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4940,11 +4940,8 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { frame .f4 -width 40 -bg green .p add .f1 .f2 .f3 .f4 pack .p - updateWidgets - # On macOS, the above updateWidgets does the job of mapping .p and its children - # but then getting the correct mapping state (0) of .f4 needs further - # updateWidgets because .f4 does not fit in the width of .p - waitForMap .f4 + waitForMap .f3 + waitForUnmap .f4 set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] -- cgit v0.12 From aa22e7eaef62c8cbc00a7e5441cea417a1b33278 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 21 Jun 2022 19:12:30 +0000 Subject: Stabilize notebook-5.1. This test once failed at least, at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). --- tests/ttk/notebook.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index d0856f0..2b9870e 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -96,11 +96,11 @@ test notebook-5.1 "Virtual events" -body { bind .t <> { lappend events changed %W } pack [set nb [ttk::notebook .t.nb]] -expand true -fill both; update - $nb add [frame $nb.f1] + $nb add [frame $nb.f1] ; # triggers <> (first tab gets autoselected) $nb add [frame $nb.f2] $nb add [frame $nb.f3] - - $nb select $nb.f1 + update + $nb select $nb.f1 ; # does not trigger <> (tab to select is already selected) update; set events } -result [list changed .t.nb] -- cgit v0.12 From c655d6b90de0f2534ea8ac33cfff62c1403d2245 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 21 Jun 2022 19:20:18 +0000 Subject: Further ruggedize unixEmbed-11.2 because it still failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). [930cc27b] allowed to confirm the timeout (500 ms, in 10 steps of 50 ms) was hit ('waitForMap .embed.b: timeout!'). Double this time! --- tests/constraints.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index b931afb..45f071e 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -248,12 +248,12 @@ namespace eval tk { # Procedures waiting for a window to be mapped or unmapped, with timeout proc waitForMap {w} { set count 0 - while {$count < 10 && (![winfo exists $w] || ![winfo ismapped $w])} { + while {$count < 20 && (![winfo exists $w] || ![winfo ismapped $w])} { updateWidgets incr count after 50 } - if {$count > 9} { + if {$count > 19} { puts "waitForMap $w: timeout!" } } -- cgit v0.12 From 64414d9d8e7c495b7f80ab1729737ccb9abc9cc0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 21 Jun 2022 21:43:02 +0000 Subject: Further ruggedize panedwindow-23.30 since [20a906bf] was not enough. The test till failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). [930cc27b] allowed to confirm the timeout (500 ms, in 10 steps of 50 ms) was hit ('waitForUnmap .f4: timeout!'). Double this time! And add more debug output when a timeout is hit. --- tests/constraints.tcl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 45f071e..2918351 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -255,17 +255,19 @@ namespace eval tk { } if {$count > 19} { puts "waitForMap $w: timeout!" + puts " exists state is [winfo exists $w]" + catch {puts " mapping state is [winfo ismapped $w]"} } } proc waitForUnmap {w} { set count 0 - while {$count < 10 && [winfo ismapped $w]} { + while {$count < 20 && [winfo ismapped $w]} { updateWidgets incr count after 50 } - if {$count > 9} { - puts "waitForUnmap $w: timeout!" + if {$count > 19} { + puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" } } -- cgit v0.12 From a924c1e1ae7b79dcb6d3fc285d030c00b94e3957 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jun 2022 03:59:03 +0000 Subject: Add more debug output in order to understand why panedwindow-23.30 still fails (seen once at GitHub on macOS with xcode in the unstable_tests branch). --- tests/constraints.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 2918351..507dcea 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -268,6 +268,7 @@ namespace eval tk { } if {$count > 19} { puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" + puts " winfo geometry is [winfo geometry $w]" } } -- cgit v0.12 From 7af54d1796313d02d07a18ce8ab01801eafdb8e3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jun 2022 21:52:34 +0000 Subject: Further ruggedize unixEmbed-11.2 because it still failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). Even with [645a3198] the time out is hit (1 second in total), after which [winfo exists .embed.b] still is O. Try to update in more steps when creating toplevels or packs windows. --- tests/constraints.tcl | 2 +- tests/unixEmbed.test | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 507dcea..1b9d106 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -268,7 +268,7 @@ namespace eval tk { } if {$count > 19} { puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" - puts " winfo geometry is [winfo geometry $w]" + puts " winfo geometry is [winfo geometry $w]" } } diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 986dc6a..1b84de5 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1303,6 +1303,7 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { pack [frame .main.f -container 1 -width 200 -height 200] -fill both updateWidgets toplevel .embed -use [winfo id .main.f] -bg green + update pack [button .embed.b -text "Emb Button" \ -command {lappend result ".embed.b"}] -padx 30 -pady 30 update -- cgit v0.12 From 39eed7da387ffc81dff38dd021195711bc9375ef Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jun 2022 22:20:13 +0000 Subject: Stabilize textImage-3.2 since after [ce12f9ac] it failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). --- tests/textImage.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/textImage.test b/tests/textImage.test index 9de9864..4d143e7 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -386,12 +386,13 @@ test textImage-4.2 {alignment checking - baseline} -setup { .t image create end -image large .t image create end -image small -align baseline .t insert end test + update # Sizes larger than 25 can be too big and lead to a negative 'norm', # at least on Windows XP with certain settings. foreach size {10 15 20 25} { font configure test_font2 -size $size array set Metrics [font metrics test_font2] - update ; .t sync + updateWidgets ; .t sync foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From 4c5e92fc40f2037e7307530382063fa1419f3ea1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jun 2022 22:48:23 +0000 Subject: In unixEmbed-11.2, make a difference in the output between the result of the winfo containing commands and the -command triggered. --- tests/unixEmbed.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 1b84de5..35cb61c 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1299,13 +1299,13 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { wm geometry .main 200x400+100+100 set result {} pack [button .main.b -text "Main Button" \ - -command {lappend result ".main.b"}] -padx 30 -pady 30 + -command {lappend result "pushed .main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both updateWidgets toplevel .embed -use [winfo id .main.f] -bg green update pack [button .embed.b -text "Emb Button" \ - -command {lappend result ".embed.b"}] -padx 30 -pady 30 + -command {lappend result "pushed .embed.b"}] -padx 30 -pady 30 update waitForMap .embed.b focus -force .main @@ -1324,7 +1324,7 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { set result } -cleanup { deleteWindows -} -result {.main.b .main.b .embed.b .embed.b} +} -result {.main.b {pushed .main.b} .embed.b {pushed .embed.b}} # cleanup -- cgit v0.12 From ae97ee0f89d278ba3041a3ae24159741918ab012 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 29 Jun 2022 20:31:57 +0000 Subject: Further stabilize panedwindow-23.30 since after [5952fd21] it failed once at GitHub Actions in branch unstable_tests on macOS with clang (no, --enable-aqua). --- tests/constraints.tcl | 1 - tests/panedwindow.test | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 1b9d106..2918351 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -268,7 +268,6 @@ namespace eval tk { } if {$count > 19} { puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" - puts " winfo geometry is [winfo geometry $w]" } } diff --git a/tests/panedwindow.test b/tests/panedwindow.test index f02858d..1fb4f99 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4940,6 +4940,7 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { frame .f4 -width 40 -bg green .p add .f1 .f2 .f3 .f4 pack .p + waitForMap .p waitForMap .f3 waitForUnmap .f4 set result [list] -- cgit v0.12 From b7e384d6d034320a3573364f6201ac43b6d5c984 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 30 Jun 2022 19:57:58 +0000 Subject: Instrument to understand why panedwindow-23.30 is still failing (unstable_tests branch, macOS, xcode). --- tests/constraints.tcl | 5 +++++ tests/panedwindow.test | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 2918351..0ad3779 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -257,7 +257,9 @@ namespace eval tk { puts "waitForMap $w: timeout!" puts " exists state is [winfo exists $w]" catch {puts " mapping state is [winfo ismapped $w]"} + return true } + return false } proc waitForUnmap {w} { set count 0 @@ -268,7 +270,10 @@ namespace eval tk { } if {$count > 19} { puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" + return true } +# return false + return true } } diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 1fb4f99..9f16d94 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4942,7 +4942,24 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { pack .p waitForMap .p waitForMap .f3 - waitForUnmap .f4 + if {[waitForUnmap .f4]} { + puts "winfo exists .f4: [winfo exists .f4]" + puts "winfo geometry .f4: [winfo geometry .f4]" + puts "winfo x .f4: [winfo x .f4]" + puts "winfo y .f4: [winfo y .f4]" + puts "winfo width .f4: [winfo width .f4]" + puts "winfo height .f4: [winfo height .f4]" + puts "winfo reqwidth .f4: [winfo reqwidth .f4]" + puts "winfo reqheight .f4: [winfo reqheight .f4]" + puts "winfo viewable .f4: [winfo viewable .f4]" + puts "winfo rootx .f4: [winfo rootx .f4]" + puts "winfo rooty .f4: [winfo rooty .f4]" + puts "winfo rootx .f3: [winfo rootx .f3]" + puts "winfo rooty .f3: [winfo rooty .f3]" + puts "winfo width .f3: [winfo width .f3]" + puts "winfo height .f3: [winfo height .f3]" + puts ".p configure: [.p configure]" + } set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] -- cgit v0.12 From ce463eefe96e579adde97246917f20cfc92eaa8a Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 30 Jun 2022 19:59:38 +0000 Subject: Oops. --- tests/constraints.tcl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 0ad3779..7dba8bc 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -272,8 +272,7 @@ namespace eval tk { puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" return true } -# return false - return true + return false } } -- cgit v0.12 From 2b750801ce523f2ce04c82bf6572efa91b46e0c5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 2 Jul 2022 23:22:03 +0000 Subject: Further ruggedize unixEmbed-11.2 because it still failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). Error message was 'bad window path name .embed' while executing 'button .embed.b -text 'Emb Button' -command {lappend result 'pushed .embed.b'}' --- tests/unixEmbed.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 35cb61c..30c00e3 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1304,6 +1304,7 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { updateWidgets toplevel .embed -use [winfo id .main.f] -bg green update + waitForMap .embed pack [button .embed.b -text "Emb Button" \ -command {lappend result "pushed .embed.b"}] -padx 30 -pady 30 update -- cgit v0.12 From 53f8ed5cae78f96ceb617674bc224d02ca5dfdbb Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Jul 2022 12:19:25 +0000 Subject: Stabilize ttk-2.8. This test was seen failing once at GitHub Actions, in branch unstable_tests, on macOS with xcode. Careful study of how this test works shows there is a race condition built in. This commit doesn't remove this race condition but should be enough to let the test always pass. --- tests/ttk/ttk.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index ad4c2d5..7e4753a 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -211,7 +211,7 @@ test ttk-2.8 "bug 3223850: button state disabled during click" -setup { } -body { bind .b {after 0 {.b configure -state disabled}} after 1 {event generate .b } - after 20 {event generate .b } + after 50 {event generate .b } set aid [after 100 {set ::ttk28 [.b instate {disabled !pressed}]}] vwait ::ttk28 after cancel $aid -- cgit v0.12 From c8649c4e2b28fe4394d8ee7cb71df7f0febbe724 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Jul 2022 19:55:05 +0000 Subject: Further stabilize unixEmbed-11.2 because it still failed once at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). [ef554a85] revealed that the .embed toplevel does not exist (even after waiting until the timeout), which may be due to an unmapped .main.f window being used in the -use option. Wait for .main.f to be mapped before creating the .embed toplevel. --- tests/unixEmbed.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 30c00e3..3a0bc9f 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1301,7 +1301,8 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { pack [button .main.b -text "Main Button" \ -command {lappend result "pushed .main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both - updateWidgets + update + waitForMap .main.f toplevel .embed -use [winfo id .main.f] -bg green update waitForMap .embed -- cgit v0.12 From 69402c77f2e4aaf38b1589f84d9fcef94666ca64 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 7 Jul 2022 03:53:45 +0000 Subject: Instrument panedwindow-23.30 a bit more. --- tests/panedwindow.test | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 9f16d94..feb0d62 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4943,8 +4943,22 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { waitForMap .p waitForMap .f3 if {[waitForUnmap .f4]} { - puts "winfo exists .f4: [winfo exists .f4]" + puts "winfo geometry .p: [winfo geometry .p]" + puts "winfo rootx .p: [winfo rootx .p]" + puts "winfo rooty .p: [winfo rooty .p]" + puts "winfo geometry .f1: [winfo geometry .f1]" + puts "winfo rootx .f1: [winfo rootx .f1]" + puts "winfo rooty .f1: [winfo rooty .f1]" + puts "winfo geometry .f2: [winfo geometry .f2]" + puts "winfo rootx .f2: [winfo rootx .f2]" + puts "winfo rooty .f2: [winfo rooty .f2]" + puts "winfo geometry .f3: [winfo geometry .f3]" + puts "winfo rootx .f3: [winfo rootx .f3]" + puts "winfo rooty .f3: [winfo rooty .f3]" puts "winfo geometry .f4: [winfo geometry .f4]" + puts "winfo rootx .f4: [winfo rootx .f4]" + puts "winfo rooty .f4: [winfo rooty .f4]" + puts "winfo exists .f4: [winfo exists .f4]" puts "winfo x .f4: [winfo x .f4]" puts "winfo y .f4: [winfo y .f4]" puts "winfo width .f4: [winfo width .f4]" @@ -4952,12 +4966,6 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { puts "winfo reqwidth .f4: [winfo reqwidth .f4]" puts "winfo reqheight .f4: [winfo reqheight .f4]" puts "winfo viewable .f4: [winfo viewable .f4]" - puts "winfo rootx .f4: [winfo rootx .f4]" - puts "winfo rooty .f4: [winfo rooty .f4]" - puts "winfo rootx .f3: [winfo rootx .f3]" - puts "winfo rooty .f3: [winfo rooty .f3]" - puts "winfo width .f3: [winfo width .f3]" - puts "winfo height .f3: [winfo height .f3]" puts ".p configure: [.p configure]" } set result [list] -- cgit v0.12 From 19343090caba5a5ade7801b50983713c7af4049c Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 12 Jul 2022 20:59:48 +0000 Subject: Attempt at fixing sporadic failures of panedwindow-23.30 at GitHub on macOS. --- macosx/tkMacOSXWm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 1bf62d9..bbadeb2 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -798,9 +798,12 @@ void TkMacOSXHandleMapOrUnmap( * have to check for the "text" manager and revert to using Tk_HandleEvent * in that case. Hopefully this can be removed when the revised text * widget is in place. + * Similarly, panedwindow-23.30 is sometimes failing with the .f4 window + * being erroneously mapped. Check for the "panedwindow" geometry manager + * here as well, and revert to using Tk_HandleEvent in that case. */ - if (geomMgrPtr && strcmp(geomMgrPtr->name, "text") == 0) { + if (geomMgrPtr && (strcmp(geomMgrPtr->name, "text") || strcmp(geomMgrPtr->name, "panedwindow")) == 0) { Tk_HandleEvent(event); return; } -- cgit v0.12 From 13f7bd8731b24736026b60e9e7923f7a3e88d6fb Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 13 Jul 2022 18:03:32 +0000 Subject: Fix my stupid mistake in previous commit --- macosx/tkMacOSXWm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index bbadeb2..0401d48 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -803,7 +803,7 @@ void TkMacOSXHandleMapOrUnmap( * here as well, and revert to using Tk_HandleEvent in that case. */ - if (geomMgrPtr && (strcmp(geomMgrPtr->name, "text") || strcmp(geomMgrPtr->name, "panedwindow")) == 0) { + if (geomMgrPtr && ((strcmp(geomMgrPtr->name, "text") == 0) || (strcmp(geomMgrPtr->name, "panedwindow") == 0))) { Tk_HandleEvent(event); return; } -- cgit v0.12 From 5aef94316d62ff1fb6c7875662c30188afd41052 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 19 Jul 2022 23:12:44 +0000 Subject: Restore comment line removed by error in the previous commit whil resolving conflicts. --- macosx/tkMacOSXWm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 790d0c4..f8561bf 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -744,6 +744,7 @@ TkWmNewWindow( /* *---------------------------------------------------------------------- + * * TkWmMapWindow -- * * This procedure is invoked to map a top-level window. This module gets -- cgit v0.12 From 607aef238d641e4203788e4062515f7323f94e4d Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 20 Jul 2022 20:52:25 +0000 Subject: Remove stabilization lines in panedwindow.test. The problem was due to the TkMacOSXHandleMapOrUnmap() approach, now removed. --- tests/panedwindow.test | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index feb0d62..29e0ced 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4922,7 +4922,7 @@ test panedwindow-23.29 {ConfigurePanes, -hide works} -setup { lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] [winfo width .p] .p paneconfigure .f2 -hide 1 - update ; after 100 ; update + update lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ @@ -4940,41 +4940,14 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { frame .f4 -width 40 -bg green .p add .f1 .f2 .f3 .f4 pack .p - waitForMap .p - waitForMap .f3 - if {[waitForUnmap .f4]} { - puts "winfo geometry .p: [winfo geometry .p]" - puts "winfo rootx .p: [winfo rootx .p]" - puts "winfo rooty .p: [winfo rooty .p]" - puts "winfo geometry .f1: [winfo geometry .f1]" - puts "winfo rootx .f1: [winfo rootx .f1]" - puts "winfo rooty .f1: [winfo rooty .f1]" - puts "winfo geometry .f2: [winfo geometry .f2]" - puts "winfo rootx .f2: [winfo rootx .f2]" - puts "winfo rooty .f2: [winfo rooty .f2]" - puts "winfo geometry .f3: [winfo geometry .f3]" - puts "winfo rootx .f3: [winfo rootx .f3]" - puts "winfo rooty .f3: [winfo rooty .f3]" - puts "winfo geometry .f4: [winfo geometry .f4]" - puts "winfo rootx .f4: [winfo rootx .f4]" - puts "winfo rooty .f4: [winfo rooty .f4]" - puts "winfo exists .f4: [winfo exists .f4]" - puts "winfo x .f4: [winfo x .f4]" - puts "winfo y .f4: [winfo y .f4]" - puts "winfo width .f4: [winfo width .f4]" - puts "winfo height .f4: [winfo height .f4]" - puts "winfo reqwidth .f4: [winfo reqwidth .f4]" - puts "winfo reqheight .f4: [winfo reqheight .f4]" - puts "winfo viewable .f4: [winfo viewable .f4]" - puts ".p configure: [.p configure]" - } + update set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] [winfo width .p] .p paneconfigure .f2 -hide 1 - update ; after 100 ; update + update lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ -- cgit v0.12 From 25306736bbf92ef57062b08f139a36034a9e390c Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 20 Jul 2022 21:03:49 +0000 Subject: Completely eradicate proc waitForMap and waitForUnmap in the test suite. The tests stability problem was due to the TkMacOSXHandleMapOrUnmap() approach, now removed. --- tests/constraints.tcl | 31 ------------------------------- tests/textWind.test | 4 ++-- tests/unixEmbed.test | 3 --- 3 files changed, 2 insertions(+), 36 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 720ff47..b4bba2b 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -255,37 +255,6 @@ namespace eval tk { } } - namespace export waitForMap waitForUnmap - # Procedures waiting for a window to be mapped or unmapped, with timeout - proc waitForMap {w} { - set count 0 - while {$count < 20 && (![winfo exists $w] || ![winfo ismapped $w])} { - updateWidgets - incr count - after 50 - } - if {$count > 19} { - puts "waitForMap $w: timeout!" - puts " exists state is [winfo exists $w]" - catch {puts " mapping state is [winfo ismapped $w]"} - return true - } - return false - } - proc waitForUnmap {w} { - set count 0 - while {$count < 20 && [winfo ismapped $w]} { - updateWidgets - incr count - after 50 - } - if {$count > 19} { - puts "waitForUnmap $w: timeout! mapping state is [winfo ismapped $w]" - return true - } - return false - } - } } diff --git a/tests/textWind.test b/tests/textWind.test index b659520..adffbc2 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -402,7 +402,7 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { .t window create 1.3 updateWidgets .t window configure 1.3 -window .f - waitForMap .f + updateWidgets list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -461,7 +461,7 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { button .t.b -text "Hello!" .t window create 1.4 -window .t.b .t window create 1.6 -window .t.b - waitForMap .t.b + updateWidgets .t index .t.b } -result {1.6} diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 3a0bc9f..33ba0ed 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1302,14 +1302,11 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { -command {lappend result "pushed .main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both update - waitForMap .main.f toplevel .embed -use [winfo id .main.f] -bg green update - waitForMap .embed pack [button .embed.b -text "Emb Button" \ -command {lappend result "pushed .embed.b"}] -padx 30 -pady 30 update - waitForMap .embed.b focus -force .main after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] -- cgit v0.12 From 7accee52915d46a0545442572d54cf7617d7e40d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 23 Jul 2022 12:01:05 +0000 Subject: Further stabilize unixEmbed-11.2 by returning to update idletasks on the mac as it was originally. --- tests/unixEmbed.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 33ba0ed..ae32679 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1301,12 +1301,12 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { pack [button .main.b -text "Main Button" \ -command {lappend result "pushed .main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both - update + updateWidgets toplevel .embed -use [winfo id .main.f] -bg green - update + updateWidgets pack [button .embed.b -text "Emb Button" \ -command {lappend result "pushed .embed.b"}] -padx 30 -pady 30 - update + updateWidgets focus -force .main after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] -- cgit v0.12 From 81028724e361bc6b871959c2248864d2555e7a7e Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 26 Jul 2022 20:44:53 +0000 Subject: Remove hardcoded values from unixEmbed-11.2 --- tests/unixEmbed.test | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index ae32679..b1382a8 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1309,13 +1309,14 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { updateWidgets focus -force .main after 100 - set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] - set y [expr {[winfo y .main ] + [winfo y .main.b] + 38}] + set x [expr {[winfo rootx .main.b] + [winfo width .main.b]/2}] + set y [expr {[winfo rooty .main.b] + [winfo height .main.b]/2}] lappend result [winfo containing $x $y] after 200 pressbutton $x $y update - set y [expr {$y + 80}] + set x [expr {[winfo rootx .embed.b] + [winfo width .embed.b]/2}] + set y [expr {[winfo rooty .embed.b] + [winfo height .embed.b]/2}] lappend result [winfo containing $x $y] after 200 pressbutton $x $y -- cgit v0.12 From c6dbab7080f3659c705a1140bcda6925da5d45d1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 13:17:38 +0000 Subject: Since [64999025af], frame-3.10 now fails at Github Actions on macOS with aqua (xcode or clang), quite repeatably. Restore frame-3.10 as it is in core-8-6-branch. --- tests/frame.test | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index 84d6b7d..fcd8867 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -673,13 +673,19 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 - updateWidgets + if {[tk windowingsystem] eq "aqua"} { + update idletasks + } else { + update + } option add *x.use [winfo id .t] toplevel .x -width 140 -height 300 -bg green - if {[tk windowingsystem] ne "aqua"} { - tkwait visibility .x + if {[tk windowingsystem] eq "aqua"} { + update idletasks + } else { + tkwait visibility .x + update } - updateWidgets list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] -- cgit v0.12 From fc534435a19cfc29172f7ab50d4b8c4199a9329b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 13:21:11 +0000 Subject: Restore unixEmbed-10.1 and -10.2 as they are in core-8-6-branch. Now they fail reliably on Linux, and on macOS at Github Actions (only - and not fully reliably). --- tests/unixEmbed.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index b1382a8..9b79d96 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1248,11 +1248,11 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 - updateWidgets + update idletasks toplevel .t1 -use [winfo id .f1] -width 150 -height 80 - updateWidgets + update idletasks wm geometry .t1 +40+50 - updateWidgets + update idletasks wm geometry .t1 } -cleanup { deleteWindows @@ -1264,11 +1264,11 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 - updateWidgets + update idletasks toplevel .t1 -use [winfo id .f1] -width 150 -height 80 - updateWidgets + update idletasks wm geometry .t1 70x300+10+20 - updateWidgets + update idletasks wm geometry .t1 } -cleanup { deleteWindows -- cgit v0.12 From 2dfe9ca1ff82c964deb8fea5747aeabcb823dd15 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 14:53:19 +0000 Subject: Restore unixEmbed-10.* to their state when they originally appeared in [d28306f679]. --- tests/unixEmbed.test | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 9b79d96..c8ca877 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1248,11 +1248,10 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 - update idletasks toplevel .t1 -use [winfo id .f1] -width 150 -height 80 - update idletasks + update wm geometry .t1 +40+50 - update idletasks + update wm geometry .t1 } -cleanup { deleteWindows @@ -1264,11 +1263,10 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 - update idletasks toplevel .t1 -use [winfo id .f1] -width 150 -height 80 - update idletasks + update wm geometry .t1 70x300+10+20 - update idletasks + update wm geometry .t1 } -cleanup { deleteWindows -- cgit v0.12 From 2454910edb800435df819548f9745ffecdd2737a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 18:32:08 +0000 Subject: Remove proc updateWidgets since it now simply runs 'update' on all platforms. --- tests/entry.test | 40 +++++----- tests/frame.test | 4 +- tests/spinbox.test | 40 +++++----- tests/textImage.test | 2 +- tests/textIndex.test | 2 +- tests/textWind.test | 212 +++++++++++++++++++++++++-------------------------- tests/unixEmbed.test | 10 +-- 7 files changed, 155 insertions(+), 155 deletions(-) diff --git a/tests/entry.test b/tests/entry.test index fcc9427..6c2291c 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1676,10 +1676,10 @@ test entry-5.7 {ConfigureEntry procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - updateWidgets + update set scrollInfo wrong .e configure -width 5 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -1921,11 +1921,11 @@ test entry-7.1 {InsertChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateWidgets + update set scrollInfo wrong .e insert 0 abcde .e insert 2 XXX - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -1938,11 +1938,11 @@ test entry-7.2 {InsertChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateWidgets + update set scrollInfo wrong .e insert 0 abcde .e insert 500 XXX - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2072,11 +2072,11 @@ test entry-8.1 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateWidgets + update set scrollInfo wrong .e insert 0 abcde .e delete 2 4 - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2088,11 +2088,11 @@ test entry-8.2 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateWidgets + update set scrollInfo wrong .e insert 0 abcde .e delete -1 2 - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2104,11 +2104,11 @@ test entry-8.3 {DeleteChars procedure} -setup { focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll - updateWidgets + update set scrollInfo wrong .e insert 0 abcde .e delete 3 1000 - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2942,11 +2942,11 @@ test entry-16.4 {EntryVisibleRange procedure} -body { test entry-17.1 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateWidgets + update set scrollInfo wrong .e delete 0 end .e insert 0 123 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2954,11 +2954,11 @@ test entry-17.1 {EntryUpdateScrollbar procedure} -body { test entry-17.2 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateWidgets + update set scrollInfo wrong .e insert 0 0123456789abcdef .e xview 3 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2966,11 +2966,11 @@ test entry-17.2 {EntryUpdateScrollbar procedure} -body { test entry-17.3 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateWidgets + update set scrollInfo wrong .e insert 0 abcdefghijklmnopqrs .e xview 6 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2983,10 +2983,10 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup { } -body { entry .e -width 5 pack .e - updateWidgets + update set scrollInfo wrong .e configure -xscrollcommand thisisnotacommand - updateWidgets + update list $x $errorInfo } -cleanup { destroy .e diff --git a/tests/frame.test b/tests/frame.test index fcd8867..01b4687 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1169,11 +1169,11 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { labelframe .f -font myfont -text Mupp place .f -x 0 -y 0 -width 40 -height 40 pack [frame .f.f] -fill both -expand 1 - updateWidgets + update set h1 [font metrics myfont -linespace] set y1 [winfo y .f.f] font configure myfont -size 20 - updateWidgets + update set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] expr {($h2 - $h1) - ($y2 - $y1)} diff --git a/tests/spinbox.test b/tests/spinbox.test index 98c88cd..661f10b 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -2017,10 +2017,10 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - updateWidgets + update set scrollInfo wrong .e configure -width 5 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -2208,10 +2208,10 @@ test spinbox-7.1 {InsertChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateWidgets + update set scrollInfo wrong .e insert 2 XXX - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2225,10 +2225,10 @@ test spinbox-7.2 {InsertChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateWidgets + update set scrollInfo wrong .e insert 500 XXX - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2359,10 +2359,10 @@ test spinbox-8.1 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateWidgets + update set scrollInfo wrong .e delete 2 4 - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2375,10 +2375,10 @@ test spinbox-8.2 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateWidgets + update set scrollInfo wrong .e delete -1 2 - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -2391,10 +2391,10 @@ test spinbox-8.3 {DeleteChars procedure} -setup { } -body { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde - updateWidgets + update set scrollInfo wrong .e delete 3 1000 - updateWidgets + update list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e @@ -3177,11 +3177,11 @@ test spinbox-16.2 {SpinboxVisibleRange procedure} -body { test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateWidgets + update set scrollInfo wrong .e delete 0 end .e insert 0 123 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -3190,10 +3190,10 @@ test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 0123456789abcdef - updateWidgets + update set scrollInfo wrong .e xview 3 - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -3201,11 +3201,11 @@ test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body { test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e - updateWidgets + update set scrollInfo wrong .e insert 0 abcdefghijklmnopqrs .e xview - updateWidgets + update format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e @@ -3218,10 +3218,10 @@ test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup { } -body { spinbox .e -width 5 pack .e - updateWidgets + update set scrollInfo wrong .e configure -xscrollcommand thisisnotacommand - updateWidgets + update list $x $errorInfo } -cleanup { destroy .e diff --git a/tests/textImage.test b/tests/textImage.test index 4d143e7..5ceecf1 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -392,7 +392,7 @@ test textImage-4.2 {alignment checking - baseline} -setup { foreach size {10 15 20 25} { font configure test_font2 -size $size array set Metrics [font metrics test_font2] - updateWidgets ; .t sync + update ; .t sync foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 diff --git a/tests/textIndex.test b/tests/textIndex.test index 6b425c5..a191e27 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -754,7 +754,7 @@ set str [string repeat "hello " 20] .t insert end "$str one two three four five six seven height nine ten\n" .t insert end "$str one two three four five six seven height nine ten\n" .t insert end "$str one two three four five six seven height nine ten\n" -updateWidgets +update test textIndex-19.1 {Display lines} { .t index "2.7 displaylinestart" diff --git a/tests/textWind.test b/tests/textWind.test index adffbc2..260ba66 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -24,7 +24,7 @@ set tHeight 6 text .t -width $tWidth -height $tHeight -bd 2 -highlightthickness 2 \ -font $fixedFont pack .t -expand 1 -fill both -updateWidgets +update .t debug on set color [expr {[winfo depth .t] > 1 ? "green" : "black"}] @@ -42,7 +42,7 @@ wm deiconify . # This update is needed on MacOS to make sure that the window is mapped # when the tests begin. -updateWidgets +update set bw [.t cget -borderwidth] set px [.t cget -padx] @@ -60,7 +60,7 @@ test textWind-1.1 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 3 -height 3 -bg $color .t window create 2.2 -window .f - updateWidgets + update list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \ [.t window configure .f -window] } -result [list \ @@ -76,7 +76,7 @@ test textWind-1.2 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 3 -height 3 -bg $color .t window create 2.2 -window .f -align top - updateWidgets + update list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \ [.t window configure .f -align] } -result [list \ @@ -102,7 +102,7 @@ test textWind-1.4 {basic tests of options} -setup { # the window .f should be wider than the fixed width frame .f -width 10 -height 20 -bg $color .t window create 2.2 -window .f -padx 5 - updateWidgets + update list [winfo geom .f] [.t window configure .f -padx] [.t bbox 2.3] } -result [list \ 10x20+[expr {$padx+2*$fixedWidth+5}]+[expr {$pady+$fixedHeight}] \ @@ -116,7 +116,7 @@ test textWind-1.5 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 20 -bg $color .t window create 2.2 -window .f -pady 4 - updateWidgets + update list [winfo geom .f] [.t window configure .f -pady] [.t bbox 2.31] } -result [list \ 10x20+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight+4}] \ @@ -130,7 +130,7 @@ test textWind-1.6 {basic tests of options} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 5 -height 5 -bg $color .t window create 2.2 -window .f -stretch 1 - updateWidgets + update list [winfo geom .f] [.t window configure .f -stretch] } -result [list \ 5x$fixedHeight+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight}] \ @@ -193,7 +193,7 @@ test textWind-2.11 {TkTextWindowCmd procedure} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 6 -bg $color .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo - updateWidgets + update .t window configure .f } -cleanup { destroy .f @@ -209,7 +209,7 @@ test textWind-2.12 {TkTextWindowCmd procedure} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 6 -bg $color .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo - updateWidgets + update list [.t window configure .f -padx 33] [.t window configure .f -padx] } -cleanup { destroy .f @@ -225,7 +225,7 @@ test textWind-2.13 {TkTextWindowCmd procedure} -setup { .t insert end "\nAnd this is a second line, which wraps around" frame .f -width 10 -height 6 -bg $color .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 - updateWidgets + update list [.t window configure .f -padx 14 -pady 15] \ [.t window configure .f -padx] [.t window configure .f -pady] } -cleanup { @@ -340,9 +340,9 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateWidgets + update .t window configure 1.3 -window {} - updateWidgets + update .t index .f } -cleanup { destroy .f @@ -354,10 +354,10 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 -window .f - updateWidgets + update set res [winfo ismapped .f] .t window configure 1.3 -window {} - updateWidgets + update lappend res [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -370,9 +370,9 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateWidgets + update .t window configure 1.3 -window {} - updateWidgets + update .t index .t.f } -cleanup { destroy .t.f @@ -384,10 +384,10 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.3 -window .t.f - updateWidgets + update set res [winfo ismapped .t.f] .t window configure 1.3 -window {} - updateWidgets + update lappend res [winfo ismapped .t.f] [.t bbox 1.4] } -cleanup { destroy .t.f @@ -400,9 +400,9 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.3 - updateWidgets + update .t window configure 1.3 -window .f - updateWidgets + update list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4] } -cleanup { destroy .f @@ -461,7 +461,7 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup { button .t.b -text "Hello!" .t window create 1.4 -window .t.b .t window create 1.6 -window .t.b - updateWidgets + update .t index .t.b } -result {1.6} @@ -502,7 +502,7 @@ test textWind-5.1 {EmbWinStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.2 -window .f - updateWidgets + update destroy .f .t index .f } -returnCodes error -result {bad text index ".f"} @@ -514,7 +514,7 @@ test textWind-5.2 {EmbWinStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.2 -window .f - updateWidgets + update destroy .f catch {.t index .f} list [.t bbox 1.2] [.t bbox 1.3] @@ -530,7 +530,7 @@ test textWind-5.3 {EmbWinStructureProc procedure} -setup { frame .f -width 10 -height 20 -bg $color .t window create 1.2 -align bottom .t window configure 1.2 -window .f - updateWidgets + update destroy .f .t index .f } -returnCodes error -result {bad text index ".f"} @@ -542,7 +542,7 @@ test textWind-5.4 {EmbWinStructureProc procedure} -setup { frame .f -width 10 -height 20 -bg $color .t window create 1.2 -align bottom .t window configure 1.2 -window .f - updateWidgets + update destroy .f catch {.t index .f} list [.t bbox 1.2] [.t bbox 1.3] @@ -556,10 +556,10 @@ test textWind-5.5 {EmbWinStructureProc procedure} -setup { } -body { .t insert 1.0 "Some sample text" .t window create 1.2 -create {frame .f -width 10 -height 20 -bg $color} - updateWidgets + update .t window configure 1.2 -create {frame .f -width 20 -height 10 -bg $color} destroy .f - updateWidgets + update list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3] } -result [list 0 1.2 \ [list [expr {$padx+2*$fixedWidth}] [expr {$pady+(($fixedHeight-10)/2)}] 20 10] \ @@ -593,9 +593,9 @@ test textWind-7.1 {EmbWinLostContentProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 10 -height 20 -bg $color .t window create 1.2 -window .f - updateWidgets + update place .f -in .t -x 100 -y 50 - updateWidgets + update list [winfo geom .f] [.t bbox 1.2] } -cleanup { destroy .f @@ -610,9 +610,9 @@ test textWind-7.2 {EmbWinLostContentProc procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 10 -height 20 -bg $color .t window create 1.2 -window .t.f - updateWidgets + update place .t.f -x 100 -y 50 - updateWidgets + update list [winfo geom .t.f] [.t bbox 1.2] } -cleanup { destroy .t.f @@ -672,7 +672,7 @@ test textWind-10.1 {EmbWinLayoutProc procedure} -setup { .t window create 1.5 -create { frame .f -width 10 -height 20 -bg $color } - updateWidgets + update list [winfo exists .f] [winfo width .f] [winfo height .f] [.t index .f] } -cleanup { destroy .f @@ -690,7 +690,7 @@ test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} -setup error "couldn't create window" } set msg xyzzy - updateWidgets + update list $msg [.t bbox 1.5] } -cleanup { rename bgerror {} @@ -710,7 +710,7 @@ test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} -setup concat gorp } set msg xyzzy - updateWidgets + update list $msg [.t bbox 1.5] } -cleanup { rename bgerror {} @@ -736,7 +736,7 @@ test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} -setup } set count 0 while {([llength $msg] < 2) && ($count < 100)} { - updateWidgets + update incr count .t bbox 1.5 after 10 @@ -766,7 +766,7 @@ test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -setup frame .t.f frame .t.f.f -width 10 -height 20 -bg $color } - updateWidgets + update lappend msg [winfo exists .t.f.f] } -cleanup { destroy .t.f @@ -783,12 +783,12 @@ test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} -setup } } -body { .t insert 1.0 "Some sample text" - updateWidgets + update .t window create 1.5 -create { concat .t } set msg {} - updateWidgets + update lappend msg [.t bbox 1.5] } -cleanup { rename bgerror {} @@ -834,9 +834,9 @@ test textWind-10.8 {EmbWinLayoutProc procedure, error in creating window} -setup concat .t2 } set msg {} - updateWidgets + update set i 0 - while {[llength $msg] == 1 && [incr i] < 200} { updateWidgets } + while {[llength $msg] == 1 && [incr i] < 200} { update } return $msg } -cleanup { destroy .t2 @@ -850,9 +850,9 @@ test textWind-10.9 {EmbWinLayoutProc procedure, steal window from self} -setup { .t insert 1.0 ABCDEFGHIJKLMNOP button .t.b -text "Hello!" .t window create 1.5 -window .t.b - updateWidgets + update .t window create 1.3 -create {concat .t.b} - updateWidgets + update .t index .t.b } -cleanup { destroy .t.b @@ -881,7 +881,7 @@ test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth}] -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateWidgets + update list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -897,7 +897,7 @@ test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth+1}] -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateWidgets + update list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -913,7 +913,7 @@ test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateWidgets + update list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -929,7 +929,7 @@ test textWind-10.14 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 220 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateWidgets + update list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -945,7 +945,7 @@ test textWind-10.15 {EmbWinLayoutProc procedure, doesn't fit on line} -setup { .t insert 1.0 "Some sample text" frame .f -width 250 -height 220 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f - updateWidgets + update list [.t bbox .f] [.t bbox 1.13] } -cleanup { destroy .f @@ -967,7 +967,7 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup { update frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - updateWidgets + update winfo geom .f } -cleanup { destroy .f @@ -988,7 +988,7 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup { update frame .t.f -width 30 -height 20 -bg $color .t window create 1.12 -window .t.f - updateWidgets + update winfo geom .t.f } -cleanup { destroy .t.f @@ -1007,12 +1007,12 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -se .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - updateWidgets + update bind .f {set x ".f configured"} set x {no configures} .t delete 1.0 .t insert 1.0 "X" - updateWidgets + update return $x } -cleanup { destroy .f @@ -1034,7 +1034,7 @@ test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} -setup { .t insert end " with junk after it." .t xview moveto 0 .t xview scroll 5 units - updateWidgets + update list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] [winfo ismapped .f2] } -cleanup { destroy .f .f2 @@ -1055,10 +1055,10 @@ test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} -setup { frame .f2 -width 40 -height 10 -bg $color .t window create end -window .f2 .t insert end " with junk after it." - updateWidgets + update .t xview moveto 0 .t xview scroll 25 units - updateWidgets + update list [winfo ismapped .f] [winfo ismapped .f2] [winfo geom .f2] [.t bbox .f2] } -cleanup { destroy .f .f2 @@ -1077,20 +1077,20 @@ test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} -setup { bind .f {lappend x mapped} bind .f {lappend x unmapped} set x created - updateWidgets + update lappend x modified .t delete 1.0 - updateWidgets + update lappend x replaced .t window configure .f -window {} .t delete 1.1 - updateWidgets + update .t window create 1.4 -window .f - updateWidgets + update lappend x off-screen .t configure -wrap none .t insert 1.0 "Enough text to make the line run off-screen" - updateWidgets + update return $x } -cleanup { destroy .f @@ -1104,7 +1104,7 @@ test textWind-13.1 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align top -padx 2 -pady 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1119,7 +1119,7 @@ test textWind-13.2 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1134,7 +1134,7 @@ test textWind-13.3 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1149,7 +1149,7 @@ test textWind-13.4 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1164,7 +1164,7 @@ test textWind-13.5 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align top -padx 2 -pady 1 -stretch 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1179,7 +1179,7 @@ test textWind-13.6 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 -stretch 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1194,7 +1194,7 @@ test textWind-13.7 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 -stretch 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1209,7 +1209,7 @@ test textWind-13.8 {EmbWinBboxProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 -stretch 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f @@ -1226,7 +1226,7 @@ test textWind-13.9 {EmbWinBboxProc procedure, spacing options} -setup { .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 - updateWidgets + update list [winfo geom .f] [.t bbox .f] } -cleanup { .t configure -spacing1 0 -spacing3 0 @@ -1243,14 +1243,14 @@ test textWind-14.1 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f - updateWidgets + update bind .f {lappend x unmapped} set x modified .t insert 1.0 x lappend x removed .t window configure .f -window {} lappend x updated - updateWidgets + update return $x } -cleanup { destroy .f @@ -1263,14 +1263,14 @@ test textWind-14.2 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f - updateWidgets + update bind .f {lappend x unmapped} set x modified .t insert 1.0 x lappend x deleted .t delete .f lappend x updated - updateWidgets + update return $x } -cleanup { destroy .f @@ -1283,10 +1283,10 @@ test textWind-14.3 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f - updateWidgets + update .t yview 2.0 set result [winfo ismapped .f] - updateWidgets ; after 10 + update ; after 10 list $result [winfo ismapped .f] } -cleanup { destroy .f @@ -1299,10 +1299,10 @@ test textWind-14.4 {EmbWinDelayedUnmap procedure} -setup { .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9" frame .t.f -width 30 -height 20 -bg $color .t window create 1.2 -window .t.f - updateWidgets + update .t yview 2.0 set result [winfo ismapped .t.f] - updateWidgets + update list $result [winfo ismapped .t.f] } -cleanup { destroy .t.f @@ -1340,9 +1340,9 @@ test textWind-16.1 {EmbWinTextStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f - updateWidgets + update pack forget .t - updateWidgets + update winfo ismapped .f } -cleanup { pack .t @@ -1357,12 +1357,12 @@ test textWind-16.2 {EmbWinTextStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f - updateWidgets + update set result {} lappend result [winfo geom .f] [.t bbox .f] frame .f2 -width 150 -height 30 -bd 2 -relief raised pack .f2 -before .t - updateWidgets + update lappend result [winfo geom .f] [.t bbox .f] } -cleanup { destroy .f .f2 @@ -1378,9 +1378,9 @@ test textWind-16.3 {EmbWinTextStructureProc procedure} -setup { .t configure -wrap none .t insert 1.0 "Some sample text" .t window create 1.6 - updateWidgets + update pack forget .t - updateWidgets + update } -cleanup { pack .t } -result {} @@ -1393,9 +1393,9 @@ test textWind-16.4 {EmbWinTextStructureProc procedure} -setup { .t insert 1.0 "Some sample text" frame .t.f -width 30 -height 20 -bg $color .t window create 1.6 -window .t.f - updateWidgets + update pack forget .t - updateWidgets + update list [winfo ismapped .t.f] [.t bbox .t.f] } -cleanup { pack .t @@ -1411,7 +1411,7 @@ test textWind-17.1 {peer widgets and embedded windows} -setup { .t window create 1.3 -window .f toplevel .tt pack [.t peer create .tt.t] - updateWidgets + update destroy .t .tt winfo exists .f } -result {0} @@ -1425,10 +1425,10 @@ test textWind-17.2 {peer widgets and embedded windows} -setup { .t window create 1.4 -window .f toplevel .tt pack [.t peer create .tt.t] - updateWidgets + update destroy .t .tt.t insert 1.0 "foo" - updateWidgets + update destroy .tt } -result {} @@ -1440,9 +1440,9 @@ test textWind-17.3 {peer widget and -create} -setup { .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] - updateWidgets + update .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateWidgets + update destroy .t .tt } -result {} @@ -1456,10 +1456,10 @@ test textWind-17.4 {peer widget deleted one window shouldn't delete others} -set toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateWidgets + update destroy .tt lappend res [.t get 1.2] - updateWidgets + update lappend res [.t get 1.2] } -cleanup { destroy .t @@ -1474,7 +1474,7 @@ test textWind-17.5 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateWidgets + update list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1489,7 +1489,7 @@ test textWind-17.6 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - updateWidgets + update list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { @@ -1505,7 +1505,7 @@ test textWind-17.7 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateWidgets + update list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1520,7 +1520,7 @@ test textWind-17.8 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateWidgets + update list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { @@ -1536,7 +1536,7 @@ test textWind-17.9 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateWidgets + update .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red] list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window] } -cleanup { @@ -1552,9 +1552,9 @@ test textWind-17.10 {peer widget window configuration} -setup { .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] - updateWidgets + update .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - updateWidgets + update # There is a blue window in the main widget .t but not in the peer .tt.t lappend res [.t window cget 1.2 -window] lappend res [.tt.t window cget 1.2 -window] @@ -1562,7 +1562,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # inserted in .t at index 1.2 will now be found in .t at index 1.3 # The underlying linked segments are common in a text widget and its peers. .tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -bg green] - updateWidgets + update lappend res [.t window cget 1.2 -window] lappend res [.t window cget 1.3 -window] # In the peer, the green window still is at 1.2, and there is no window at 1.3 @@ -1573,7 +1573,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # the embedded window found at index 1.2 in .t is the one originally at 1.2 in .t, i.e. # the blue one .t window configure 1.2 -create {destroy %W.f ; update ; frame %W.f -width 50 -height 7 -bg red} - updateWidgets + update # The main widget .t still has a window named .t.f at 1.2. This is NOT the blue # frame but the red frame from the -create script, which bears the same name. lappend res [.t window cget 1.2 -window] @@ -1582,7 +1582,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # When removing the -window option the create script plays, therefore .t still has # the red frame .t.f at 1.2 .t window configure 1.2 -window {} - updateWidgets + update lappend res [.t window cget 1.2 -window] # The -create script associated to index 1.2 applies to all peers (that's the reason # why the manual states that "If multiple peer widgets are in use, it is usually simpler @@ -1590,7 +1590,7 @@ test textWind-17.10 {peer widget window configuration} -setup { # when removing the -window option in the peer, the -create script is run, which replaces # the green frame by the red one named as per the -create script, i.e. .tt.t.f .tt.t window configure 1.2 -window {} - updateWidgets + update lappend res [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1604,12 +1604,12 @@ test textWind-18.1 {embedded window deletion triggered by a script bound to {.t delete .f} - updateWidgets + update # this shall not crash (bug 1501749) after 100 {.t yview end} tkwait visibility .f2 after 200 - updateWidgets + update } -cleanup { destroy .t .f .f2 } -result {} @@ -1621,7 +1621,7 @@ test textWind-18.2 {text widget deletion triggered by a script bound to embedded for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} .t window create end -window [frame .f -background red -width 80 -height 80] bind .f {destroy .t} - updateWidgets + update # this shall not crash (bug 1501749) after 100 {.t yview end} tkwait window .t @@ -1639,7 +1639,7 @@ test textWind-18.3 {embedded window destruction in cascade} -setup { bind .t.b1 {destroy .t.b2 ; set x 1} button .t.b2 .t window create 2.0 -window .t.b2 - updateWidgets + update # this shall not crash (bug 54fe7a5e71) after 100 {.t delete 1.0 end} tkwait variable x diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index c8ca877..669ef40 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1279,9 +1279,9 @@ test unixEmbed-11.1 {focus -force works for embedded toplevels} -constraints { } -body { toplevel .t pack [frame .t.f -container 1 -width 200 -height 200] -fill both - updateWidgets + update toplevel .embed -use [winfo id .t.f] -bg green - updateWidgets + update focus -force .t focus -force .embed focus @@ -1299,12 +1299,12 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { pack [button .main.b -text "Main Button" \ -command {lappend result "pushed .main.b"}] -padx 30 -pady 30 pack [frame .main.f -container 1 -width 200 -height 200] -fill both - updateWidgets + update toplevel .embed -use [winfo id .main.f] -bg green - updateWidgets + update pack [button .embed.b -text "Emb Button" \ -command {lappend result "pushed .embed.b"}] -padx 30 -pady 30 - updateWidgets + update focus -force .main after 100 set x [expr {[winfo rootx .main.b] + [winfo width .main.b]/2}] -- cgit v0.12 From 7f78bbbef42914118ae9253ddaeb699fe424271b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 18:33:34 +0000 Subject: Remove proc updateWidgets since it now simply runs 'update' on all platforms. --- tests/textDisp.test | 854 ++++++++++++++++++++++++++-------------------------- 1 file changed, 427 insertions(+), 427 deletions(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index 4a060a7..de6fd22 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -14,9 +14,9 @@ namespace import -force tcltest::test # The delay procedure needs to wait long enough for the asynchronous updates # performed by the text widget to run. proc delay {} { - updateWidgets + update after 100 - updateWidgets + update } # The procedure below is used as the scrolling command for the text; @@ -140,7 +140,7 @@ wm withdraw . wm minsize . 1 1 wm positionfrom . user wm deiconify . -updateWidgets +update # Some window managers (like olwm under SunOS 4.1.3) misbehave in a way # that tends to march windows off the top and left of the screen. If @@ -221,7 +221,7 @@ test textDisp-0.3 {double tag elide transition} { .txt tag configure SYSTEM -elide 0 .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {TRAFFIC SYSTEM} - updateWidgets + update destroy .txt } {} @@ -234,7 +234,7 @@ test textDisp-0.4 {double tag elide transition} { .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {SYSTEM TRAFFIC} # Crash was here. - updateWidgets + update destroy .txt } {} @@ -248,7 +248,7 @@ test textDisp-0.5 {double tag elide transition} { .txt insert end "\n" {SYSTEM TRAFFIC} .txt insert end "\n" WELCOME # Crash was here. - updateWidgets + update destroy .txt } {} @@ -279,7 +279,7 @@ test textDisp-1.2 {GetStyle procedure, wrapmode} { .t tag configure x -wrap word .t tag configure y -wrap none .t tag raise y - updateWidgets + update set result [list [.t bbox 2.20]] .t tag add x 2.0 2.1 lappend result [.t bbox 2.20] @@ -351,7 +351,7 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} -setup { scan [wm geom .] %dx%d width height } -body { wm geom . [expr {$width+1}]x$height - updateWidgets + update .t configure -wrap char .t delete 1.0 end .t insert 1.0 "This isxx some sample text for testing." @@ -359,7 +359,7 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} -setup { list [.t bbox 1.19] [.t bbox 1.20] } -cleanup { wm geom . {} - updateWidgets + update } -result [list [list [xchar 19] [yline 1] [expr {$fixedWidth+1}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.9 {LayoutDLine, marks and tags} { @@ -661,12 +661,12 @@ test textDisp-3.1 {different character sizes} { test textDisp-4.1 {UpdateDisplayInfo, basic} { .t delete 1.0 end .t insert end "Line 1\nLine 2\nLine 3\n" - updateWidgets + update .t delete 2.0 2.end - updateWidgets + update set res $tk_textRelayout .t insert 2.0 "New Line 2" - updateWidgets + update lappend res [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout } [list 2.0 \ [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ @@ -676,13 +676,13 @@ test textDisp-4.1 {UpdateDisplayInfo, basic} { test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} { .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + update .t mark set x 2.21 .t delete 2.2 - updateWidgets + update set res $tk_textRelayout .t insert 2.0 X - updateWidgets + update lappend res [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list 2.0 2.20 \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ @@ -692,10 +692,10 @@ test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} { test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} { .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + update .t mark set x 2.21 .t delete 2.2 - updateWidgets + update list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ @@ -706,7 +706,7 @@ test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} { .t configure -wrap none .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + update list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ {} \ @@ -717,11 +717,11 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} { wm overrideredirect . 1 } wm geom . 103x$height - updateWidgets + update .t configure -wrap none .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + update list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] 1 $fixedHeight] \ {} \ @@ -744,21 +744,21 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} { frame .f2 -width 20 -height 100 pack .f2 -before .f wm geom . 103x103 - updateWidgets + update .t configure -wrap none -borderwidth 2 .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + update set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout] wm overrideredirect . 0 - updateWidgets + update set expected [list [list [xchar 0] [yline 1] 1 1] {} 1.0] lequal $x $expected } {1} catch {destroy .f2} .t configure -borderwidth 0 -wrap char wm geom . {} -updateWidgets +update test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} { # This test was failing on Windows because the title bar on . # was a certain minimum size and it was interfering with the size @@ -773,28 +773,28 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 1.0 - updateWidgets + update .t yview 16.0 - updateWidgets + update set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] wm overrideredirect . 0 - updateWidgets + update set x } {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}} test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 16.0 - updateWidgets + update .t delete 5.0 14.0 - updateWidgets + update set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] } {1.0 {5.0 4.0 3.0 2.0 1.0} {1.0 2.0 3.0 4.0 5.0 eof}} test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 16.0 - updateWidgets + update .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] } [list [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ @@ -803,18 +803,18 @@ test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview end - updateWidgets + update .t delete 13.0 end - updateWidgets + update list [.t index @0,0] $tk_textRelayout $tk_textRedraw } {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}} test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview end - updateWidgets + update .t delete 14.0 end - updateWidgets + update list [.t index @0,0] $tk_textRelayout $tk_textRedraw } {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}} test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { @@ -823,11 +823,11 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { button .b -text "Test" -bd 2 -highlightthickness 2 .t window create 3.end -window .b .t yview moveto 1 - updateWidgets + update .t yview moveto 0 - updateWidgets + update .t yview moveto 1 - updateWidgets + update winfo ismapped .b } {0} .t configure -wrap word @@ -840,33 +840,33 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag add x 1.0 end .t yview 1.0 - updateWidgets + update .t yview scroll 3 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}} test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end .t yview 1.0 - updateWidgets + update .t yview scroll 3 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {11.0 12.0 13.0}} test textDisp-4.15 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag add x 1.0 end .t yview 4.0 - updateWidgets + update .t yview scroll -2 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0 4.0 11.0}} test textDisp-4.16 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end .t yview 4.0 - updateWidgets + update .t yview scroll -2 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} { @@ -874,9 +874,9 @@ test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} { .t delete 1.0 end .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" - updateWidgets + update .t xview scroll 3 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw [.t bbox 2.0] [.t bbox 2.5] \ [.t bbox 2.23] } [list {} {1.0 2.0 3.0 4.0} \ @@ -888,9 +888,9 @@ test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} { .t delete 1.0 end .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" - updateWidgets + update .t xview scroll 100 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list {} {1.0 2.0 3.0 4.0} \ [list [xcharr 19] [yline 2] $fixedWidth $fixedHeight]] @@ -899,10 +899,10 @@ test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} { .t delete 1.0 end .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" - updateWidgets + update .t xview moveto 0 .t xview scroll -10 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw [.t bbox 2.5] } [list {} {1.0 2.0 3.0 4.0} \ [list [xchar 5] [yline 2] $fixedWidth $fixedHeight]] @@ -913,9 +913,9 @@ test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} { .t insert end "\nLine 3\nLine 4" .t xview moveto 0.0 .t xview scroll 100 units - updateWidgets + update .t delete 2.30 2.44 - updateWidgets + update list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list 2.0 {1.0 2.0 3.0 4.0} \ [list [xcharr 5] [yline 2] $fixedWidth $fixedHeight]] @@ -925,9 +925,9 @@ test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} { .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" .t xview moveto .9 - updateWidgets + update .t xview moveto .6 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {}} test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} { @@ -936,7 +936,7 @@ test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" .t xview scroll 25 units - updateWidgets + update .t configure -wrap word list [.t bbox 2.0] [.t bbox 2.16] } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ @@ -947,7 +947,7 @@ test textDisp-4.23 {UpdateDisplayInfo, no horizontal scrolling except for -wrap .t insert end "Short line 1\nLine 2 is long enough to scroll horizontally" .t insert end "\nLine 3\nLine 4" .t xview scroll 25 units - updateWidgets + update .t configure -wrap char list [.t bbox 2.0] [.t bbox 2.16] } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ @@ -967,7 +967,7 @@ test textDisp-5.1 {DisplayDLine, handling of spacing} { .t window create 1.7 -window .t.f2 -align center .t window create 2.1 -window .t.f3 -align bottom .t window create 2.10 -window .t.f4 -align baseline - updateWidgets + update list [winfo geometry .t.f1] [winfo geometry .t.f2] \ [winfo geometry .t.f3] [winfo geometry .t.f4] } [list 10x4+[xchar 3]+[expr {[yline 1]+8}] \ @@ -984,7 +984,7 @@ test textDisp-5.2 {DisplayDLine, line resizes during display} { frame .t.f -width 20 -height 20 -bd 2 -relief raised bind .t.f {.t.f configure -width 30 -height 30} .t window create insert -window .t.f - updateWidgets + update list [winfo width .t.f] [winfo height .t.f] } [list 30 30] @@ -995,9 +995,9 @@ test textDisp-6.1 {scrolling in DisplayText, scroll up} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 2.0 3.0 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 10.0} {2.0 10.0}} test textDisp-6.2 {scrolling in DisplayText, scroll down} { @@ -1006,9 +1006,9 @@ test textDisp-6.2 {scrolling in DisplayText, scroll down} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t insert 2.0 "New Line 2\n" - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { @@ -1018,10 +1018,10 @@ test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t insert 2.end "is so long that it wraps" .t insert 4.end "is so long that it wraps" - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 4.0 4.20} {2.0 2.20 4.0 4.20}} test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} { @@ -1031,10 +1031,10 @@ test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t insert 2.end "is so long that it wraps around, not once but three times" .t insert 4.end "is so long that it wraps" - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}} test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {aquaKnownBug} { @@ -1047,9 +1047,9 @@ test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {aquaKnownB foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 1.6 1.end - updateWidgets + update destroy .f2 list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}} @@ -1066,31 +1066,31 @@ test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {aquaKn foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 1.6 1.end destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}} .t configure -bd 0 test textDisp-6.7 {DisplayText, vertical scrollbar updates} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-6.8 {DisplayText, vertical scrollbar updates} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1" - updateWidgets + update set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - updateWidgets + update .t count -update -ypixels 1.0 end ; update set scrollInfo } [list 0.0 [expr {10.0/13}]] @@ -1098,12 +1098,12 @@ test textDisp-6.8 {DisplayText, vertical scrollbar updates} { test textDisp-6.9 {DisplayText, horizontal scrollbar updates} { .t configure -wrap none .t delete 1.0 end - updateWidgets + update set scrollInfo unchanged .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} { @@ -1122,9 +1122,9 @@ test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} .t insert end "\nLine 8\n" .t window create end -create { button %W.button_three -text "Button 3"} - updateWidgets + update .t delete 2.0 3.0 - updateWidgets + update list $tk_textEmbWinDisplay } {{4.0 6.0}} @@ -1139,27 +1139,27 @@ test textDisp-7.1 {TkTextRedrawRegion} {aquaKnownBug} { # constrained by aquaKnownBug until ticket [aad0231f07] is fixed frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.2 -relwidth 0.6 -rely 0.22 -relheight 0.55 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {1.40 2.0 3.0 4.0 5.0 6.0}} test textDisp-7.2 {TkTextRedrawRegion} {aquaKnownBug} { # constrained by aquaKnownBug until ticket [aad0231f07] is fixed frame .f2 -bg #ff0000 place .f2 -in .t -relx 0 -relwidth 0.5 -rely 0 -relheight 0.5 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {1.0 1.20 1.40 2.0 3.0}} test textDisp-7.3 {TkTextRedrawRegion} {aquaKnownBug} { # constrained by aquaKnownBug until ticket [aad0231f07] is fixed frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.5 -relwidth 0.5 -rely 0.5 -relheight 0.5 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {4.0 5.0 6.0 7.0 8.0}} test textDisp-7.4 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1167,9 +1167,9 @@ test textDisp-7.4 {TkTextRedrawRegion} {aquaKnownBug} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 0 -relheight 0.2 \ -bordermode ignore - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20}} test textDisp-7.5 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1177,9 +1177,9 @@ test textDisp-7.5 {TkTextRedrawRegion} {aquaKnownBug} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 1.0 -relheight 0.2 \ -anchor s -bordermode ignore - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 7.0 8.0}} test textDisp-7.6 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1187,9 +1187,9 @@ test textDisp-7.6 {TkTextRedrawRegion} {aquaKnownBug} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \ -anchor w -bordermode ignore - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.7 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1197,9 +1197,9 @@ test textDisp-7.7 {TkTextRedrawRegion} {aquaKnownBug} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 1.0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \ -anchor e -bordermode ignore - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.8 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1209,9 +1209,9 @@ test textDisp-7.8 {TkTextRedrawRegion} {aquaKnownBug} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.0 -relwidth 0.4 -rely 0.35 -relheight 0.4 \ -anchor nw -bordermode ignore - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 eof}} .t configure -bd 0 @@ -1223,9 +1223,9 @@ test textDisp-8.1 {TkTextChanged: redisplay whole lines} { foreach i {3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 2.36 2.38 - updateWidgets + update list $tk_textRelayout $tk_textRedraw [.t bbox 2.32] } [list {2.0 2.18 2.38} {2.0 2.18 2.38} [list [xchar 14] [yline 3] $fixedWidth $fixedHeight]] .t configure -wrap char @@ -1235,9 +1235,9 @@ test textDisp-8.2 {TkTextChanged, redisplay whole lines} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t insert 1.2 xx - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.3 {TkTextChanged} { @@ -1246,9 +1246,9 @@ test textDisp-8.3 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t insert 2.0 xx - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.4 {TkTextChanged} { @@ -1257,9 +1257,9 @@ test textDisp-8.4 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 1.5 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.5 {TkTextChanged} { @@ -1268,9 +1268,9 @@ test textDisp-8.5 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 1.40 1.44 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.6 {TkTextChanged} { @@ -1279,9 +1279,9 @@ test textDisp-8.6 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 1.41 1.44 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.7 {TkTextChanged} { @@ -1290,9 +1290,9 @@ test textDisp-8.7 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 1.2 1.end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 9.0 10.0}} test textDisp-8.8 {TkTextChanged} { @@ -1301,9 +1301,9 @@ test textDisp-8.8 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 2.2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.9 {TkTextChanged} { @@ -1312,9 +1312,9 @@ test textDisp-8.9 {TkTextChanged} { foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - updateWidgets + update .t delete 2.0 3.0 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} test textDisp-8.10 {TkTextChanged} { @@ -1322,23 +1322,23 @@ test textDisp-8.10 {TkTextChanged} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 2.19 - updateWidgets + update .t delete 2.19 - updateWidgets + update set tk_textRedraw } {2.0 2.20 eof} test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-screen} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n" .t configure -yscrollcommand scroll - updateWidgets + update set scrollInfo "" .t insert end "a\nb\nc\n" # We need to wait for our asychronous callbacks to update the # scrollbar - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update .t configure -yscrollcommand "" set scrollInfo } {0.0 0.625} @@ -1351,27 +1351,27 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an .t tag add hidden 5.0 8.0 .t tag configure hidden -elide true .t mark set insert 9.0 - updateWidgets + update .t mark set insert 8.0 ; # up one line - updateWidgets + update set res [list $tk_textRedraw] .t mark set insert 12.2 ; # in the visible text - updateWidgets + update lappend res $tk_textRedraw .t mark set insert 6.5 ; # in the hidden text - updateWidgets + update lappend res $tk_textRedraw .t mark set insert 3.5 ; # in the visible text again - updateWidgets + update lappend res $tk_textRedraw .t mark set insert 3.8 ; # within the same line - updateWidgets + update lappend res $tk_textRedraw } {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {3.0 4.0}} test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { .t delete 1.0 end .t insert 1.0 \nLine2\nLine3\n - updateWidgets + update .t insert 3.0 "" .t delete 1.0 2.0 update idletasks @@ -1381,9 +1381,9 @@ test textDisp-9.1 {TkTextRedrawTag} -body { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateWidgets + update .t tag add big 2.2 2.4 - updateWidgets + update list $tk_textRelayout $tk_textRedraw # glob matching is to have some tolerance on actually used font size # while still testing what we want to test @@ -1392,9 +1392,9 @@ test textDisp-9.2 {TkTextRedrawTag} -body { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateWidgets + update .t tag add big 1.2 2.4 - updateWidgets + update list $tk_textRelayout $tk_textRedraw # glob matching is to have some tolerance on actually used font size # while still testing what we want to test @@ -1403,22 +1403,22 @@ test textDisp-9.3 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateWidgets + update .t tag add big 2.2 2.4 - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.4 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateWidgets + update .t tag add big 2.2 2.20 - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.5 {TkTextRedrawTag} -setup { @@ -1426,25 +1426,25 @@ test textDisp-9.5 {TkTextRedrawTag} -setup { } -body { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" - updateWidgets + update .t tag add big 2.2 2.end - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } -cleanup { .t configure -height [expr {[.t cget -height]-10}] - updateWidgets + update } -result {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.6 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap" - updateWidgets + update .t tag add big 2.2 3.5 - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}} test textDisp-9.7 {TkTextRedrawTag} { @@ -1452,9 +1452,9 @@ test textDisp-9.7 {TkTextRedrawTag} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 2.19 - updateWidgets + update .t tag remove big 2.19 - updateWidgets + update set tk_textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} -body { @@ -1462,9 +1462,9 @@ test textDisp-9.8 {TkTextRedrawTag} -body { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateWidgets + update .t tag add big 2.0 2.5 - updateWidgets + update set tk_textRedraw # glob matching is to have some tolerance on actually used font size # while still testing what we want to test @@ -1474,9 +1474,9 @@ test textDisp-9.9 {TkTextRedrawTag} -body { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateWidgets + update .t tag add big 1.5 2.5 - updateWidgets + update set tk_textRedraw # glob matching is to have some tolerance on actually used font size # while still testing what we want to test @@ -1486,10 +1486,10 @@ test textDisp-9.10 {TkTextRedrawTag} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateWidgets + update set tk_textRedraw none .t tag add big 1.3 1.5 - updateWidgets + update set tk_textRedraw } none test textDisp-9.11 {TkTextRedrawTag} { @@ -1497,9 +1497,9 @@ test textDisp-9.11 {TkTextRedrawTag} { .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 - updateWidgets + update .t tag add big 1.0 2.0 - updateWidgets + update set tk_textRedraw } {} test textDisp-9.12 {TkTextRedrawTag} { @@ -1510,9 +1510,9 @@ test textDisp-9.12 {TkTextRedrawTag} { } .t tag configure hidden -elide true .t tag add hidden 2.6 3.6 - updateWidgets + update .t tag add hidden 3.11 4.6 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {2.0 {2.0 eof}} test textDisp-9.13 {TkTextRedrawTag} { @@ -1525,9 +1525,9 @@ test textDisp-9.13 {TkTextRedrawTag} { .t tag add hidden 6.8 7.17 .t tag configure hidden -background red .t tag configure hidden -elide true - updateWidgets + update .t tag configure hidden -elide false - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 6.0 7.0} {2.0 6.0 7.0}} test textDisp-9.14 {TkTextRedrawTag} { @@ -1537,7 +1537,7 @@ test textDisp-9.14 {TkTextRedrawTag} { } .tnocrash tag configure mytag1 -relief raised .tnocrash tag configure mytag2 -relief solid - updateWidgets + update proc doit {} { .tnocrash tag add mytag1 4.0 5.0 .tnocrash tag add mytag2 4.0 5.0 @@ -1559,9 +1559,9 @@ test textDisp-10.1 {TkTextRelayoutWindow} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" - updateWidgets + update .t configure -bg black - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}} .t configure -bg [lindex [.t configure -bg] 3] @@ -1575,7 +1575,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} { .top.t see insert tkwait visibility .top.t place .top.t -width 150 -height 100 - updateWidgets + update .top.t index @0,0 } {1.0} catch {destroy .top} @@ -1585,96 +1585,96 @@ catch {destroy .top} for {set i 2} {$i <= 200} {incr i} { .t insert end "\nLine $i" } -updateWidgets +update test textDisp-11.1 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t index @0,0 } {30.0} test textDisp-11.2 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t yview 32.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.3 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t yview 28.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.4 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t yview 31.4 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {31.0 40.0} test textDisp-11.5 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 31.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {30.0 {}} test textDisp-11.6 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 28.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.7 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 26.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}} test textDisp-11.8 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 41.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.9 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 43.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {38.0 {40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0}} test textDisp-11.10 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview 10000.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0}} test textDisp-11.11 {TkTextSetYView} { .t yview 195.0 - updateWidgets + update set tk_textRedraw {} .t yview 197.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}} test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} { .t insert 10.0 "Long line with enough text to wrap\n" .t yview 1.0 - updateWidgets + update set tk_textRedraw {} .t see 10.30 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {2.0 10.20} .t delete 10.0 11.0 @@ -1688,15 +1688,15 @@ test textDisp-11.13 {TkTestSetYView, partially visible last line} { for {set i 2} {$i <= 100} {incr i} { .top.t insert end "\nLine $i" } - updateWidgets + update scan [wm geometry .top] "%dx%d" w2 h2 wm geometry .top ${w2}x[expr {$h2-2}] - updateWidgets + update .top.t yview 1.0 - updateWidgets + update set tk_textRedraw {} .top.t see 5.0 - updateWidgets + update # Note, with smooth scrolling, the results of this test # have changed, and the old '2.0 {5.0 6.0}' is quite wrong. list [.top.t index @0,0] $tk_textRedraw @@ -1710,29 +1710,29 @@ pack .top.t for {set i 2} {$i <= 20} {incr i} { .top.t insert end "\nLine $i" } -updateWidgets +update test textDisp-11.14 {TkTextSetYView, only a few lines visible} { .top.t yview 5.0 - updateWidgets + update .top.t see 10.0 .top.t index @0,0 } {8.0} test textDisp-11.15 {TkTextSetYView, only a few lines visible} { .top.t yview 5.0 - updateWidgets + update .top.t see 11.0 .top.t index @0,0 # The index 9.0 should be just visible by a couple of pixels } {9.0} test textDisp-11.16 {TkTextSetYView, only a few lines visible} { .top.t yview 8.0 - updateWidgets + update .top.t see 5.0 .top.t index @0,0 } {5.0} test textDisp-11.17 {TkTextSetYView, only a few lines visible} { .top.t yview 8.0 - updateWidgets + update .top.t see 4.0 .top.t index @0,0 # The index 2.0 should be just visible by a couple of pixels @@ -1747,7 +1747,7 @@ test textDisp-11.18 {TkTextSetYView, see in elided lines} { .top.t tag add hidden 4.10 "4.10 lineend" .top.t tag add hidden 5.15 10.3 .top.t tag configure hidden -elide true - updateWidgets + update .top.t see "8.0 lineend" # The index "8.0 lineend" is on screen despite elided -> no scroll .top.t index @0,0 @@ -1767,19 +1767,19 @@ test textDisp-11.19 {TkTextSetYView, see in elided lines} { # Indices 21.0, 17.0 and 15.0 are all on the same display line # therefore index @0,0 shall be the same for all of them .top.t see end - updateWidgets + update .top.t see 21.0 - updateWidgets + update set ind1 [.top.t index @0,0] .top.t see end - updateWidgets + update .top.t see 17.0 - updateWidgets + update set ind2 [.top.t index @0,0] .top.t see end - updateWidgets + update .top.t see 15.0 - updateWidgets + update set ind3 [.top.t index @0,0] list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}] } {1 1} @@ -1802,7 +1802,7 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} } set lineheight [font metrics [.top.t cget -font] -linespace] wm geometry .top 200x[expr {$lineheight / 2}] - updateWidgets + update .top.t see 1.0 .top.t index @0,[expr {$lineheight - 2}] } {1.0} @@ -1814,9 +1814,9 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} { pack [.top.t peer create .top.p] -side left pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y .top.p configure -startline 5 -endline 35 -yscrollcommand {.top.sb set} - updateWidgets + update .top.p yview moveto 0 - updateWidgets + update set res [.top.p get @0,0 "@0,0 lineend"] destroy .top.p set res @@ -1827,38 +1827,38 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} { .t insert 50.0 "This is a long line, one that will wrap around twice.\n" test textDisp-12.1 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 52.0 - updateWidgets + update .t index @0,0 } {49.0} test textDisp-12.2 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 53.0 - updateWidgets + update .t index @0,0 } {50.0} test textDisp-12.3 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 50.10 - updateWidgets + update .t index @0,0 } {45.0} .t configure -wrap none test textDisp-12.4 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 53.0 - updateWidgets + update .t index @0,0 } {48.0} test textDisp-12.5 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 50.10 - updateWidgets + update .t index @0,0 } {45.0} @@ -1881,7 +1881,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} { test textDisp-13.4 {TkTextSeeCmd procedure} { .t xview moveto 0 .t yview moveto 0 - updateWidgets + update .t see 4.2 .t index @0,0 } {1.0} @@ -1889,7 +1889,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - updateWidgets + update .t see 12.1 .t index @0,0 } {3.0} @@ -1897,7 +1897,7 @@ test textDisp-13.6 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - updateWidgets + update .t see 30.50 set x [.t index @0,0] .t configure -wrap none @@ -1908,7 +1908,7 @@ test textDisp-13.7 {TkTextSeeCmd procedure} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.40 - updateWidgets + update .t see 30.50 .t yview 25.0 .t see 30.50 @@ -1928,7 +1928,7 @@ test textDisp-13.8 {TkTextSeeCmd procedure} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - updateWidgets + update .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1952,7 +1952,7 @@ test textDisp-13.9 {TkTextSeeCmd procedure} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - updateWidgets + update .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1991,13 +1991,13 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { .top2.t2 insert end [string repeat "Line $i: éèàçù" 5]\n } wm geometry .top2 300x200+0+0 - updateWidgets + update .top2.t2 see "1.0 lineend" - updateWidgets + update set ref [.top2.t2 index @0,0] .top2.t2 insert "1.0 lineend" ç .top2.t2 see "1.0 lineend" - updateWidgets + update set new [.top2.t2 index @0,0] set res [.top2.t2 compare $ref == $new] destroy .top2 @@ -2008,7 +2008,7 @@ wm geom . {} .t configure -wrap none test textDisp-14.1 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateWidgets + update .t insert end xxxxxxxxx\n .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" @@ -2018,7 +2018,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} { .t configure -wrap char test textDisp-14.2 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateWidgets + update .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -2027,7 +2027,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} { .t configure -wrap none test textDisp-14.3 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateWidgets + update .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -2120,43 +2120,43 @@ for {set i 1} {$i < 99} {incr i} { .t insert 50.0 "This is a long line, one that will wrap around twice.\n" test textDisp-15.1 {ScrollByLines procedure, scrolling backwards} { .t yview 45.0 - updateWidgets + update .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - updateWidgets + update .t yview scroll -2 units .t index @0,0 } {50.20} test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - updateWidgets + update .t yview scroll -4 units .t index @0,0 } {49.0} test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} { .t yview 50.20 - updateWidgets + update .t yview scroll -2 units .t index @0,0 } {49.0} test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} { .t yview 50.40 - updateWidgets + update .t yview scroll -2 units .t index @0,0 } {50.0} test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} { .t yview 3.2 - updateWidgets + update .t yview scroll -5 units .t index @0,0 } {1.0} test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} { .t yview 48.0 - updateWidgets + update .t yview scroll 4 units .t index @0,0 } {50.40} @@ -2182,7 +2182,7 @@ test textDisp-15.8 {Scrolling near end of window} { for {set i 1} {$i < $textheight} {incr i} { .tf.f.t insert end "\nLine $i" } - updateWidgets + update set refind [.tf.f.t index @0,[winfo height .tf.f.t]] # Should scroll and should not crash! .tf.f.t yview scroll 1 unit @@ -2202,7 +2202,7 @@ for {set i 2} {$i <= 200} {incr i} { .t tag add big 100.0 105.0 .t insert 151.end { has a lot of extra text, so that it wraps around on the screen several times over.} .t insert 153.end { also has largely enough extra text to wrap.} -updateWidgets +update set totpix [.t count -update -ypixels 1.0 end] # check that the wrapping lines wrap exactly 6 times in total (4 times for line 151, and twice for line 153), # this is an assumption of the upcoming tests @@ -2230,7 +2230,7 @@ test textDisp-16.5 {TkTextYviewCmd procedure} { } {1 {bad option "-bogus": must be moveto or scroll}} test textDisp-16.6 {TkTextYviewCmd procedure, integer position} { .t yview 100.0 - updateWidgets + update .t yview 98 .t index @0,0 } {99.0} @@ -2314,7 +2314,7 @@ test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} { text .top1.t -height 3 -width 4 -wrap none -setgrid 1 -padx 6 \ -spacing3 6 pack .top1.t - updateWidgets + update .top1.t insert end "1\n2\n3\n4\n5\n6" .top1.t yview moveto 0.3333 set result [.top1.t yview] @@ -2335,7 +2335,7 @@ test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} { } {1 {expected integer but got "badInt"}} test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 - updateWidgets + update .t yview scroll -1 pages .t index @0,0 } {42.0} @@ -2344,13 +2344,13 @@ test textDisp-16.22.1 {TkTextYviewCmd procedure, "scroll" option, back pages} { } {1 {ambiguous argument "p": must be units, pages, or pixels}} test textDisp-16.23 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 - updateWidgets + update .t yview scroll -3 pa .t index @0,0 } {26.0} test textDisp-16.24 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 5.0 - updateWidgets + update .t yview scroll -3 pa .t index @0,0 } {1.0} @@ -2361,32 +2361,32 @@ test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} -set pack .f2 -side top } -body { .t configure -height 1 - updateWidgets + update .t yview 50.0 - updateWidgets + update .t yview scroll -1 pages set x [.t index @0,0] .t configure -height 10 - updateWidgets + update set x } -cleanup { destroy .f2 } -result {49.0} test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 50.0 - updateWidgets + update .t yview scroll 1 pages .t index @0,0 } {58.0} test textDisp-16.27 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 50.0 - updateWidgets + update .t yview scroll 2 pages .t index @0,0 } {66.0} test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 98.0 - updateWidgets + update # The man page does not say it but the code does: scrolling 1 page actually uses the # window height minus two lines, so that there's some overlap between adjacent pages. # Note: it's a bit tricky but we only need to subtract one [bo] from [winfo height .t] here @@ -2397,24 +2397,24 @@ test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} { } {1} test textDisp-16.29 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t configure -height 1 - updateWidgets + update .t yview 50.0 - updateWidgets + update .t yview scroll 1 pages set x [.t index @0,0] .t configure -height 10 - updateWidgets + update set x } {51.0} test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 45.0 - updateWidgets + update .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-16.31 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 149.0 - updateWidgets + update .t yview scroll 4 units .t index @0,0 } {151.40} @@ -2519,7 +2519,7 @@ test textDisp-16.42 {TkTextYviewCmd procedure with indices in elided lines} { .t tag configure hidden -elide true .t yview 35.0 .t yview scroll [expr {- 15 * $fixedHeight}] pixels - updateWidgets + update .t index @0,0 } {5.0} test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { @@ -2533,7 +2533,7 @@ test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { .t tag configure hidden -elide true .t yview 35.0 .t yview scroll -15 units - updateWidgets + update .t index @0,0 } {5.0} test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { @@ -2544,9 +2544,9 @@ test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { .t insert end "$x 1111\n$x 2222\n$x 3333\n$x 4444\n$x 5555\n$x 6666" hidden } .t tag configure hidden -elide true ; # 5 hidden lines - updateWidgets + update .t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0 - updateWidgets + update .t index @0,0 } {2.0} @@ -2574,83 +2574,83 @@ test textDisp-17.5 {TkTextScanCmd procedure} { test textDisp-17.6 {TkTextScanCmd procedure} { .t yview 1.0 .t xview moveto 0 - updateWidgets + update set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]] .t scan mark 40 60 .t scan dragto 35 55 - updateWidgets + update lequal [.t index @0,0] $expected } {1} test textDisp-17.7 {TkTextScanCmd procedure} { # 1st result .t yview 1.0 .t xview moveto 0 - updateWidgets + update set expected [.t index @[expr {[bo]+20*$fixedWidth-50}],[expr {[bo]+9*$fixedHeight-50}]] .t yview 10.0 .t xview scroll 20 units - updateWidgets + update .t scan mark -10 60 .t scan dragto -5 65 - updateWidgets + update set x [.t index @0,0] # 2nd result .t yview 1.0 .t xview moveto 0 - updateWidgets + update lappend expected [.t index @[expr {[bo]+20*$fixedWidth-50-50}],[expr {[bo]+9*$fixedHeight-50-70}]] .t yview 10.0 .t xview scroll 20 units - updateWidgets + update .t scan mark -10 60 .t scan dragto -5 65 - updateWidgets + update .t scan dragto 0 72 - updateWidgets + update lequal [list $x [.t index @0,0]] $expected } {1} test textDisp-17.8 {TkTextScanCmd procedure} { .t yview 1.0 .t xview moveto 0 - updateWidgets + update set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]] .t scan mark 0 60 .t scan dragto 30 100 - updateWidgets + update .t scan dragto 25 95 - updateWidgets + update lequal [.t index @0,0] $expected } {1} test textDisp-17.9 {TkTextScanCmd procedure} { .t yview end .t xview moveto 0 - updateWidgets + update # this brings us at lower right corner of the text .t xview scroll 100 units - updateWidgets + update # this does not trigger any scroll, we're already at the corner .t scan mark 90 60 .t scan dragto 10 0 - updateWidgets + update set expected [.t index @[expr {[winfo width .t]-[bo]-40}],[expr {[winfo height .t]-[bo]-50}]] set expected [.t index "$expected - [.t cget -height] lines - [.t cget -width] chars"] .t scan dragto 14 5 - updateWidgets + update lequal [.t index @0,0] $expected } {1} .t configure -wrap word test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} { .t yview 10.0 - updateWidgets + update set origin [.t index @0,0] set expected [.t index "$origin - [expr {int(ceil(50.0/$fixedHeight))}] display lines"] .t scan mark -10 60 .t scan dragto -5 65 - updateWidgets + update set x [.t index @0,0] lappend expected [.t index "$origin - [expr {int(ceil((50.0+70.0)/$fixedHeight))}] display lines"] .t scan dragto 0 72 - updateWidgets + update lequal [list $x [.t index @0,0]] $expected } {1} .t configure -xscrollcommand scroll -yscrollcommand {} @@ -2661,7 +2661,7 @@ test textDisp-18.1 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-18.2 {GetXView procedure} { @@ -2670,13 +2670,13 @@ test textDisp-18.2 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-18.3 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-18.4 {GetXView procedure} { @@ -2685,7 +2685,7 @@ test textDisp-18.4 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxx\n .t insert end xxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-18.5 {GetXView procedure} { @@ -2695,7 +2695,7 @@ test textDisp-18.5 {GetXView procedure} { .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx .t xview scroll 31 units - updateWidgets + update set scrollInfo } [list [expr {31.0/55}] [expr {51.0/55}]] test textDisp-18.6 {GetXView procedure} { @@ -2706,27 +2706,27 @@ test textDisp-18.6 {GetXView procedure} { .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" .t xview moveto 0 .t xview scroll 31 units - updateWidgets + update set x {} lappend x $scrollInfo .t configure -wrap char - updateWidgets + update lappend x $scrollInfo .t configure -wrap word - updateWidgets + update lappend x $scrollInfo .t configure -wrap none - updateWidgets + update lappend x $scrollInfo } [list [list [expr {31.0/56}] [expr {51.0/56}]] {0.0 1.0} {0.0 1.0} [list 0.0 [expr {5.0/14}]]] test textDisp-18.7 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end - updateWidgets + update set scrollInfo unchanged .t insert end xxxxxx\n .t insert end xxx - updateWidgets + update set scrollInfo } {unchanged} test textDisp-18.8 {GetXView procedure} { @@ -2740,10 +2740,10 @@ test textDisp-18.8 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n - updateWidgets + update .t delete 1.0 end .t configure -xscrollcommand scrollError - updateWidgets + update set x } {{scrolling error} {scrolling error while executing @@ -2759,37 +2759,37 @@ catch {rename bogus {}} test textDisp-19.1 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-19.2 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update set scrollInfo "unchanged" .t insert 1.0 "Line1\nLine2" - updateWidgets + update set scrollInfo } {unchanged} test textDisp-19.3 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update set scrollInfo "unchanged" .t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + update set scrollInfo } {unchanged} test textDisp-19.4 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1" - updateWidgets + update set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - updateWidgets + update set scrollInfo } [list 0.0 [expr {70.0/91}]] test textDisp-19.5 {GetYView procedure} { @@ -2800,7 +2800,7 @@ test textDisp-19.5 {GetYView procedure} { .t insert end "\nLine $i" } .t insert 2.end " is really quite long; in fact it's so long that it wraps three times" - updateWidgets + update set x $scrollInfo } {0.0 0.625} test textDisp-19.6 {GetYView procedure} { @@ -2812,7 +2812,7 @@ test textDisp-19.6 {GetYView procedure} { } .t insert 2.end " is really quite long; in fact it's so long that it wraps three times" .t yview 4.0 - updateWidgets + update set x $scrollInfo } {0.375 1.0} test textDisp-19.7 {GetYView procedure} { @@ -2824,7 +2824,7 @@ test textDisp-19.7 {GetYView procedure} { } .t insert 2.end " is really quite long; in fact it's so long that it wraps three times" .t yview 2.26 - updateWidgets + update set x $scrollInfo } {0.125 0.75} test textDisp-19.8 {GetYView procedure} { @@ -2836,7 +2836,7 @@ test textDisp-19.8 {GetYView procedure} { } .t insert 10.end " is really quite long; in fact it's so long that it wraps three times" .t yview 2.0 - updateWidgets + update .t count -update -ypixels 1.0 end set x $scrollInfo } {0.0625 0.6875} @@ -2848,7 +2848,7 @@ test textDisp-19.9 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 3.0 - updateWidgets + update set scrollInfo } [list [expr {4.0/30}] 0.8] test textDisp-19.10 {GetYView procedure} { @@ -2859,7 +2859,7 @@ test textDisp-19.10 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 11.0 - updateWidgets + update set scrollInfo } [list [expr {1.0/3}] 1.0] test textDisp-19.10.1 {Widget manipulation causes height miscount} { @@ -2870,7 +2870,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} { .t insert end "\nLine $i" } .t yview 11.0 - updateWidgets + update .t configure -wrap word .t delete 1.0 end .t insert 1.0 "Line 1" @@ -2880,7 +2880,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." .t yview insert - updateWidgets + update .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -2894,7 +2894,7 @@ test textDisp-19.11 {GetYView procedure} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." .t yview insert - updateWidgets + update .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -3032,10 +3032,10 @@ test textDisp-19.12 {GetYView procedure, partially visible last line} { pack .top.t -expand yes -fill both .top.t insert end "Line 1\nLine 2\nLine 3\nLine 4\nLine 5" # Need to wait for asychronous calculations to complete. - updateWidgets + update scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - updateWidgets + update .top.t yview } [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]] test textDisp-19.13 {GetYView procedure, partially visible last line} { @@ -3046,10 +3046,10 @@ test textDisp-19.13 {GetYView procedure, partially visible last line} { pack .top.t -expand yes -fill both .top.t insert end "Line 1\nLine 2\nLine 3\nLine 4 has enough text to wrap around at least once" # Need to wait for asychronous calculations to complete. - updateWidgets + update scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - updateWidgets + update .top.t yview } [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]] catch {destroy .top} @@ -3063,14 +3063,14 @@ test textDisp-19.14 {GetYView procedure} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." # Need to update so everything is calculated. - updateWidgets + update .t count -update -ypixels 1.0 end delay set scrollInfo "unchanged" .t mark set insert 3.0 .t tag configure x -background red .t tag add x 1.0 5.0 - updateWidgets + update .t tag delete x set scrollInfo } {unchanged} @@ -3083,14 +3083,14 @@ test textDisp-19.15 {GetYView procedure} { } .t insert end "\nThis last line wraps around four " .t insert end "times with a bit little left on the last line." - updateWidgets + update .t configure -yscrollcommand scrollError proc bgerror args { global x errorInfo errorCode set x [list $args $errorInfo $errorCode] } .t delete 1.0 end - updateWidgets + update rename bgerror {} .t configure -yscrollcommand scroll set x @@ -3112,9 +3112,9 @@ test textDisp-19.16 {count -ypixels} { .t insert end "\nThis last line wraps around four " .t insert end "times with a little bit left on the last line." # Need to update so everything is calculated. - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set res [list \ [.t count -ypixels 1.0 end] \ [.t count -update -ypixels 1.0 end] \ @@ -3137,9 +3137,9 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} { } .t tag add hidden 5.15 20.15 .t tag configure hidden -elide true - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set res [list \ [.t count -ypixels 1.0 6.0] \ [.t count -ypixels 2.0 7.5] \ @@ -3173,12 +3173,12 @@ test textDisp-19.18 {count -ypixels with indices in elided lines} { .t tag add hidden 5.15 20.15 .t tag configure hidden -elide true .t yview 35.0 - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set res [.t count -ypixels 5.0 25.0] .t yview scroll [expr {- 15 * $fixedHeight}] pixels - updateWidgets + update lappend res [.t count -ypixels 5.0 25.0] } [list [expr {5 * $fixedHeight}] [expr {5 * $fixedHeight}]] test textDisp-19.19 {count -ypixels with indices in elided lines} { @@ -3191,7 +3191,7 @@ test textDisp-19.19 {count -ypixels with indices in elided lines} { .t tag add hidden 5.27 11.0 .t tag configure hidden -elide true .t yview 5.0 - updateWidgets + update set res [list [.t count -ypixels 5.0 11.0] [.t count -ypixels 5.0 11.20]] } [list [expr {1 * $fixedHeight}] [expr {2 * $fixedHeight}]] .t delete 1.0 end @@ -3300,7 +3300,7 @@ for {set i 2} {$i <= 200} {incr i} { .t configure -wrap word .t delete 50.0 51.0 .t insert 50.0 "This is a long line, one that will wrap around twice.\n" -updateWidgets +update .t tag add x 50.1 test textDisp-22.1 {TkTextCharBbox} { .t config -wrap word @@ -3321,58 +3321,58 @@ test textDisp-22.2 {TkTextCharBbox} { [list [xchar 0] [yline 10] $fixedWidth $fixedHeight]] test textDisp-22.3 {TkTextCharBbox, cut-off lines} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - updateWidgets + update set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \ [list [xchar 1] [yline 11] $fixedWidth [expr {($height-1)-$oriHeight}]]] lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected } {1} test textDisp-22.4 {TkTextCharBbox, cut-off lines} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - updateWidgets + update set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \ [list [xchar 1] [yline 11] $fixedWidth [expr {($height+1)-$oriHeight}]]] lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected } {1} test textDisp-22.5 {TkTextCharBbox, cut-off char} { wm geometry . {} - updateWidgets + update .t config -wrap none .t yview 10.0 wm geom . [expr {$width-(20-7)*$fixedWidth}]x$height - updateWidgets + update .t bbox 15.6 } [list [xchar 6] [yline 6] $fixedWidth $fixedHeight] test textDisp-22.6 {TkTextCharBbox, line visible but not char} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 .t tag add big 20.2 20.5 wm geom . ${width}x[expr {$height+3}] - updateWidgets + update set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \ {} \ [list [xchar 2] [yline 11] [font measure $bigFont "n"] [expr {($height+3)-$oriHeight}]]] lequal [list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2]] $expected } {1} wm geom . {} -updateWidgets +update test textDisp-22.7 {TkTextCharBbox, different character sizes} { .t config -wrap char .t yview 10.0 .t tag add big 12.2 12.5 - updateWidgets + update list [.t bbox 12.1] [.t bbox 12.2] } [list [list [xchar 1] [expr {[yline 3]+$ascentDiff}] $fixedWidth $fixedHeight] \ [list [xchar 2] [yline 3] [font measure $bigFont "n"] $bigHeight]] @@ -3405,7 +3405,7 @@ test textDisp-22.9 {TkTextCharBbox, handling of spacing} { .t window create 1.7 -window .t.f2 -align center .t window create 2.1 -window .t.f3 -align bottom .t window create 2.10 -window .t.f4 -align baseline - updateWidgets + update list [.t bbox .t.f1] [.t bbox .t.f2] [.t bbox .t.f3] [.t bbox .t.f4] \ [.t bbox 1.1] [.t bbox 2.9] } [list [list [xchar 3] [expr {[yline 1]+8}] 10 4] \ @@ -3424,7 +3424,7 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} { .t tag add hidden 2.8 2.13 .t tag add hidden 6.8 7.13 .t tag configure hidden -elide true - updateWidgets + update list \ [expr {[lindex [.t bbox 2.9] 0] - [lindex [.t bbox 2.8] 0]}] \ [expr {[lindex [.t bbox 2.10] 0] - [lindex [.t bbox 2.8] 0]}] \ @@ -3446,7 +3446,7 @@ test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} { } .t tag add hidden 1.30 2.5 .t tag configure hidden -elide true - updateWidgets + update list \ [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.4] 0]}] \ [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.5] 0]}] @@ -3460,7 +3460,7 @@ for {set i 2} {$i <= 200} {incr i} { .t configure -wrap word .t delete 50.0 51.0 .t insert 50.0 "This is a long line, one that will wrap around twice.\n" -updateWidgets +update test textDisp-23.1 {TkTextDLineInfo} { .t config -wrap word .t yview 48.0 @@ -3473,44 +3473,44 @@ test textDisp-23.1 {TkTextDLineInfo} { .t config -bd 4 test textDisp-23.2 {TkTextDLineInfo} { .t config -wrap word - updateWidgets + update .t yview 48.0 .t dlineinfo 50.40 } [list [bo] [yline 5] [xw 13] $fixedHeight $fixedAscent] .t config -bd 0 test textDisp-23.3 {TkTextDLineInfo} { .t config -wrap none - updateWidgets + update .t yview 48.0 list [.t dlineinfo 50.40] [.t dlineinfo 57.3] } [list [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \ [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent]] test textDisp-23.4 {TkTextDLineInfo, cut-off lines} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - updateWidgets + update set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \ [list [bo] [yline 11] [xw 7] [expr {($height-1)-$oriHeight}] $fixedAscent]] lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected } {1} test textDisp-23.5 {TkTextDLineInfo, cut-off lines} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - updateWidgets + update set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \ [list [bo] [yline 11] [xw 7] [expr {($height+1)-$oriHeight}] $fixedAscent]] lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected } {1} wm geom . {} -updateWidgets +update test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} { .t config -wrap none .t delete 1.0 end @@ -3518,7 +3518,7 @@ test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} { .t insert end "Second line is a very long one that doesn't all fit.\n" .t insert end "Third" .t xview scroll 6 units - updateWidgets + update list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0] } [list [list [expr {[xw -6]+[bo]}] [yline 1] [xw 10] $fixedHeight $fixedAscent] \ [list [expr {[xw -6]+[bo]}] [yline 2] [xw 52] $fixedHeight $fixedAscent] \ @@ -3549,7 +3549,7 @@ test textDisp-24.1 {TkTextCharLayoutProc} { [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.2 {TkTextCharLayoutProc} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end @@ -3560,20 +3560,20 @@ test textDisp-24.2 {TkTextCharLayoutProc} { incr wi -$fixedWidth } wm geom . [expr {$wi+1}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.3 {TkTextCharLayoutProc} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width-1}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected @@ -3583,7 +3583,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} { .t delete 1.0 end .t insert 1.0 01234567890123456789\n012345678901234567890 wm geom . {} - updateWidgets + update list [.t bbox 1.19] [.t bbox 1.20] [.t bbox 2.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 20] [yline 1] 0 $fixedHeight] \ @@ -3596,7 +3596,7 @@ test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} # note: windows refuses to shrink enough therefore the constraint set wi [expr {[winfo width .f]+[bo]+[xw 1]}] wm geom . ${wi}x$height - updateWidgets + update list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 2.0] } [list [list [xchar 0] [yline 1] [expr {$fixedWidth-[bo]}] $fixedHeight] \ [list [expr {[xchar 1]-[bo]}] [yline 1] 0 $fixedHeight] \ @@ -3606,13 +3606,13 @@ test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} { .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . {} - updateWidgets + update list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end @@ -3623,46 +3623,46 @@ test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} { incr wi -$fixedWidth } wm geom . [expr {$wi+1}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width-1}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width-6}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-6-$oriWidth)}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end .t insert 1.0 "a b c d e f g h i j k l m n o p" wm geom . [expr {$width-7}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-7-$oriWidth)}] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected @@ -3674,7 +3674,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui # set text widget width to 2 pixels more than 20-char width set wi [expr {[winfo width .f]+2*[bo]+[xw 20]+2}] wm geom . ${wi}x$height - updateWidgets + update set result [list [.t bbox 1.21] [.t bbox 2.0]] .t mark set insert 1.21 lappend result [.t bbox 1.21] [.t bbox 2.0] @@ -3683,7 +3683,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui [list [expr {[xchar 20]+2}] [yline 1] 0 $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] wm geom . {} -updateWidgets +update test textDisp-24.12 {TkTextCharLayoutProc, tab causes wrap} { .t configure -wrap char .t delete 1.0 end @@ -3699,31 +3699,31 @@ test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . {} - updateWidgets + update list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] {}] test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap none .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width+1}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 20] [yline 1] [expr {$width+1-$oriWidth}] $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap none .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width-1}]x$height - updateWidgets + update set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 20] [yline 1] [expr {$width-1-$oriWidth}] $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected @@ -3738,7 +3738,7 @@ test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} { # set text widget width to [bo] pixels (no chars fit in the widget at all) set wi [expr {[winfo width .f]+[bo]}] wm geom . ${wi}x$height - updateWidgets + update list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2] } [list [list [xchar 0] [yline 1] 1 $fixedHeight] \ [list [xchar 0] [yline 2] 1 $fixedHeight] \ @@ -3751,7 +3751,7 @@ test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} { .t delete 1.0 end .t insert 1.0 "This is a line that wraps around" wm geom . {} - updateWidgets + update list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] @@ -3760,7 +3760,7 @@ test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} { .t delete 1.0 end .t insert 1.0 "xxThis is a line that wraps around" wm geom . {} - updateWidgets + update list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17] [.t bbox 1.21] } [list [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 16] [yline 1] [xe 16] $fixedHeight] \ @@ -3771,7 +3771,7 @@ test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} { .t delete 1.0 end .t insert 1.0 "xxThis is a line that wraps around" wm geom . {} - updateWidgets + update list [.t bbox 1.14] [.t bbox 1.15] [.t bbox 1.16] } [list [list [xchar 14] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \ @@ -3796,7 +3796,7 @@ test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} { [list [xchar 1] [expr {[yline 2]+2}] $fixedWidth $fixedHeight] \ [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+2}] $fixedAscent]] .t configure -width 30 -updateWidgets +update test textDisp-24.21 {TkTextCharLayoutProc, word breaks} { .t configure -wrap word .t delete 1.0 end @@ -3826,7 +3826,7 @@ test textDisp-24.23 {TkTextCharLayoutProc, word breaks} { } [list [xchar 0] [yline 3] 50 20] catch {destroy .t.f} .t configure -width 20 -updateWidgets +update # Next test is currently constrained to not run on mac (aqua) because on # aqua it fails due to wrong implementation of tabs with right justification # (the text is not rendered at all). This is a bug. @@ -3843,7 +3843,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup { pack .tt } -body { .tt insert end \t9\n\t99\n\t999 - updateWidgets + update set expected [list [list [expr {[bo .tt]+40-$fixedWidth}] [yline 1 .tt] $fixedWidth $fixedHeight] \ [list [expr {[bo .tt]+40-$fixedWidth}] [yline 2 .tt] $fixedWidth $fixedHeight] \ [list [expr {[bo .tt]+40-$fixedWidth}] [yline 3 .tt] $fixedWidth $fixedHeight]] @@ -3854,7 +3854,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup { .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 \ -tabs 100 -updateWidgets +update test textDisp-25.1 {CharBboxProc procedure, check tab width} { .t delete 1.0 end .t insert 1.0 abc\td\tfgh @@ -3865,7 +3865,7 @@ test textDisp-25.1 {CharBboxProc procedure, check tab width} { .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 -pady 0 \ -tabs {} -updateWidgets +update test textDisp-26.1 {AdjustForTab procedure, no tabs} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -3992,7 +3992,7 @@ test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} { .t tag add y 1.9 button .b -text "=" .t window create 1.3 -window .b - updateWidgets + update lindex [.t bbox 1.5] 0 } {120} test textDisp-26.13 {AdjustForTab procedure, not enough space} { @@ -4050,7 +4050,7 @@ test textDisp-26.14.2 {AdjustForTab procedure, not enough space} { .t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \ -wrap char -updateWidgets +update test textDisp-27.1 {SizeOfTab procedure, old-style tabs} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -4144,7 +4144,7 @@ test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential # Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding, # so must we. set tab [expr {[bo] + int(0.5 + $tab + $cm)}] - updateWidgets + update set res [.t bbox 2.23] set expected [list [expr {[xchar 23]-$tab}] [yline 2] $fixedWidth $fixedHeight] lequal [lset res 0 [expr {[lindex $res 0] - $tab}]] $expected @@ -4165,7 +4165,7 @@ test textDisp-27.7.1 {SizeOfTab procedure, center alignment, wrap -none (potenti # Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding, # so must we. set tab [expr {[bo] + int(0.5 + $tab + $cm)}] - updateWidgets + update set res [.t bbox 2.23] .t configure -tabstyle tabular lset res 0 [expr {[lindex $res 0] - $tab}] @@ -4179,17 +4179,17 @@ test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem} } .t configure -tabs $interpolatetab -wrap none -width 150 .t insert 1.0 [string repeat "a\t" 20] - updateWidgets + update set res [.t bbox 1.20] # Now, Tk's interpolated tabs should be the same as # non-interpolated. .t configure -tabs $precisetab - updateWidgets + update expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]} } {0} .t configure -wrap char -tabs {} -width 20 -updateWidgets +update test textDisp-27.8 {SizeOfTab procedure, right alignment} { .t delete 1.0 end .t insert 1.0 a\t\txyzzyabc @@ -4238,11 +4238,11 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} -setup { .t2.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n" pack .t2.t wm geometry .t2 +0+0 - updateWidgets + update .t2.t configure -yscrollcommand bizarre_scroll .t2.t yview 100.0 set result [.t2.t index @0,0] - updateWidgets + update lappend result [.t2.t index @0,0] } -cleanup { destroy .t2 @@ -4261,7 +4261,7 @@ test textDisp-29.1 {miscellaneous: lines wrap but are still too long} -setup { .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateWidgets + update set expected [list [list 0.0 [expr {20.0*$fixedWidth/300}]] \ 300x50+[bo .t2.t]+[yline 2 .t2.t] \ [list [xchar 1 .t2.t] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] @@ -4282,9 +4282,9 @@ test textDisp-29.2 {miscellaneous: lines wrap but are still too long} -setup { .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateWidgets + update .t2.t xview scroll 1 unit - updateWidgets + update set expected [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] \ 300x50+[expr {[bo .t2.t]-$fixedWidth}]+[yline 2 .t2.t] \ [list [expr {[bo .t2.t]-$fixedWidth+$fixedWidth}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] @@ -4304,9 +4304,9 @@ test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} -setup { pack .t2.s -side bottom -fill x .t2.t insert end 1\n .t2.t insert end [string repeat "abc" 30] - updateWidgets + update .t2.t xview scroll 5 unit - updateWidgets + update .t2.t xview } -cleanup { destroy .t2 @@ -4324,9 +4324,9 @@ test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} -setup { .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateWidgets + update .t2.t xview scroll 2 unit - updateWidgets + update set expected [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] \ 300x50+[expr {[bo .t2.t]-2*$fixedWidth}]+[yline 2 .t2.t] \ {}] @@ -4347,9 +4347,9 @@ test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} -setup { .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateWidgets + update .t2.t xview scroll 7 pixels - updateWidgets + update set expected [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth+7)/300}]] \ 300x50+[expr {[bo .t2.t]-7}]+[yline 2 .t2.t] \ [list [expr {[bo .t2.t]+$fixedWidth-7}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] @@ -4370,9 +4370,9 @@ test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} -setup { .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateWidgets + update .t2.t xview scroll 17 pixels - updateWidgets + update set expected [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth+17)/300}]] \ 300x50+[expr {[bo .t2.t]-17}]+[yline 2 .t2.t] \ {}] @@ -4395,7 +4395,7 @@ test textDisp-29.2.5 {miscellaneous: can show last character} -setup { grid columnconfigure .t2 0 -weight 1 grid rowconfigure .t2 0 -weight 1 grid rowconfigure .t2 1 -weight 0 - updateWidgets + update set xv [.t2.t xview] set xd [expr {[lindex $xv 1] - [lindex $xv 0]}] .t2.t xview moveto [expr {1.0-$xd}] @@ -4423,9 +4423,9 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} -setup { .t2.t insert end 123 frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised .t2.t window create 1.1 -window .t2.t.f - updateWidgets + update .t2.t xview scroll 200 units - updateWidgets + update set expected [list [list [expr {double(300-20*$fixedWidth)/300}] 1.0] \ 300x50+[expr {-(300-20*$fixedWidth-[bo .t2.t])}]+[yline 2 .t2.t] \ {}] @@ -4444,7 +4444,7 @@ test textDisp-30.1 {elided text joining multiple logical lines} -setup { .t2.t insert 1.0 "1111\n2222\n3333" .t2.t tag configure elided -elide 1 -background red .t2.t tag add elided 1.2 3.2 - updateWidgets + update .t2.t count -update -displaylines 1.0 end } -cleanup { destroy .t2 @@ -4459,7 +4459,7 @@ test textDisp-30.2 {elided text joining multiple logical lines} -setup { .t2.t insert 1.0 "1111\n2222\n3333" .t2.t tag configure elided -elide 1 -background red .t2.t tag add elided 1.2 2.2 - updateWidgets + update .t2.t count -update -displaylines 1.0 end } -cleanup { destroy .t2 @@ -4467,7 +4467,7 @@ test textDisp-30.2 {elided text joining multiple logical lines} -setup { catch {destroy .t2} .t configure -height 1 -updateWidgets +update test textDisp-31.1 {line embedded window height update} { set res {} @@ -4485,7 +4485,7 @@ test textDisp-31.1 {line embedded window height update} { test textDisp-31.2 {line update index shifting} { set res {} .t.f configure -height 100 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -4509,7 +4509,7 @@ test textDisp-31.3 {line update index shifting} { # have been performed. set res {} .t.f configure -height 100 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -4533,7 +4533,7 @@ test textDisp-31.4 {line embedded image height update} { image create photo textest -height 100 -width 10 .t delete 3.0 .t image create 3.0 -image textest - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 lappend res [.t count -ypixels 1.0 end] @@ -4545,7 +4545,7 @@ test textDisp-31.4 {line embedded image height update} { test textDisp-31.5 {line update index shifting} { set res {} textest configure -height 100 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 .t insert 1.0 "abc\n" @@ -4620,19 +4620,19 @@ test textDisp-32.0 {everything elided} { .tt insert 0.0 HELLO .tt tag configure HIDE -elide 1 .tt tag add HIDE 0.0 end - updateWidgets + update destroy .tt } {} test textDisp-32.1 {everything elided} { # Must not crash pack [text .tt] - updateWidgets + update .tt insert 0.0 HELLO - updateWidgets + update .tt tag configure HIDE -elide 1 - updateWidgets + update .tt tag add HIDE 0.0 end - updateWidgets + update destroy .tt } {} test textDisp-32.2 {elide and tags} { @@ -4643,11 +4643,11 @@ test textDisp-32.2 {elide and tags} { {testtag1 testtag3} \ {[this bit here uses tags 2 and 3]} \ {testtag2 testtag3} - updateWidgets + update # indent left margin of tag 1 by 20 pixels # text should be indented .tt tag configure testtag1 -lmargin1 20 - updateWidgets + update #1 set res {} lappend res [list [.tt index "1.0 + 0 displaychars"] \ @@ -4656,7 +4656,7 @@ test textDisp-32.2 {elide and tags} { # hide tag 1, remaining text should not be indented, since # the indented tag and character is hidden. .tt tag configure testtag1 -elide 1 - updateWidgets + update #2 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4667,7 +4667,7 @@ test textDisp-32.2 {elide and tags} { # indent left margin of tag 2 by 20 pixels # text should not be indented, since tag1 has lmargin1 of 0. .tt tag configure testtag2 -lmargin1 20 - updateWidgets + update #3 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4676,7 +4676,7 @@ test textDisp-32.2 {elide and tags} { # the bbox of 1.0 should have zero width and zero indent, # since it is elided at that position. .tt tag configure testtag1 -elide 1 - updateWidgets + update #4 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4689,7 +4689,7 @@ test textDisp-32.2 {elide and tags} { # precedence over testtag1, and is applied to the # start of the text. .tt tag configure testtag3 -lmargin1 20 - updateWidgets + update #5 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4698,7 +4698,7 @@ test textDisp-32.2 {elide and tags} { # since it still has testtag3 on it. Again the # bbox of 1.0 should have 0. .tt tag configure testtag1 -elide 1 - updateWidgets + update #6 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4736,7 +4736,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup { .tt insert end ":)" emoticon .tt image create end -image $img pack .tt - updateWidgets + update } -cleanup { image delete $img destroy .tt @@ -4758,20 +4758,20 @@ test textDisp-32.4 {Button-1 click with elided lines - Bug 18371b7ce7} -setup { test textDisp-33.0 {one line longer than fits in the widget} { pack [text .tt -wrap char] - updateWidgets + update .tt insert 1.0 [string repeat "more wrap + " 300] - updateWidgets + update .tt see 1.0 lindex [.tt yview] 0 } {0.0} test textDisp-33.1 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] - updateWidgets + update .tt insert 1.0 [string repeat "more wrap + " 300] - updateWidgets + update .tt yview "1.0 +1 displaylines" - updateWidgets + update if {[lindex [.tt yview] 0] > 0.1} { set result "window should be scrolled to the top" } else { @@ -4782,7 +4782,7 @@ test textDisp-33.2 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] .tt debug 1 - updateWidgets + update set tk_textHeightCalc "" set timer [after 200 lappend tk_textHeightCalc "Timed out"] .tt insert 1.0 [string repeat "more wrap + " 1] @@ -4795,7 +4795,7 @@ test textDisp-33.3 {one line longer than fits in the widget} { pack [text .tt -wrap char] set tk_textHeightCalc "" .tt insert 1.0 [string repeat "more wrap + " 300] - updateWidgets + update .tt sync # Each line should have been recalculated just once expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]} @@ -4804,7 +4804,7 @@ test textDisp-33.4 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] .tt insert 1.0 [string repeat "more wrap + " 300] - updateWidgets + update set idx [.tt index "1.0 + 1 displaylines"] .tt yview $idx if {[lindex [.tt yview] 0] > 0.1} { @@ -4825,7 +4825,7 @@ test textDisp-33.5 {bold or italic fonts} win { .tt tag configure bi -font bi .tt tag configure no -font no .tt insert end abcd no efgh bi ijkl\n no - updateWidgets + update set bb {} for {set i 0} {$i < 12} {incr i 4} { lappend bb [lindex [.tt bbox 1.$i] 0] @@ -4851,7 +4851,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { .t1 insert end $txt set ge [winfo geometry .] scan $ge "%dx%d+%d+%d" width height left top - updateWidgets + update .t1 sync set negative 0 bind .t1 <> { if {%d < 0} {set negative 1} } @@ -4861,7 +4861,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { # Thus we use this way to check for regression regarding bug 2677890, # i.e. to check that the fix for this bug really is still in. wm geometry . "[expr {$width * 2}]x$height+$left+$top" - updateWidgets + update .t1 sync set negative } -cleanup { @@ -4899,7 +4899,7 @@ test textDisp-36.1 {Display bug with 'yview insert'} -constraints {knownBug} -se } -body { .t1 tag add elide 1.3 2.0 .t1 yview insert - updateWidgets + update # wish now panics: "CalculateDisplayLineHeight called with bad indexPtr" .t1 yview scroll -1 pixels } -cleanup { -- cgit v0.12 From 2fd4a617b1ba3e7970edf3eea85d953548cd8039 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 18:34:10 +0000 Subject: Remove proc updateWidgets since it now simply runs 'update' on all platforms. --- tests/constraints.tcl | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 466914f..23b48d1 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -243,20 +243,6 @@ namespace eval tk { } namespace export controlPointerWarpTiming - # Procedures for updating all widgets. These are isolated here - # to allow for variations between platforms, but are currently the - # same for all platforms (see ticket [bfea11a916]). - namespace export updateWidgets - if {[tk windowingsystem] == "aqua"} { - proc updateWidgets {} { - update - } - } else { - proc updateWidgets {} { - update - } - } - } } -- cgit v0.12 From 653eed0098ae6ecc10861d6614f9ae3570baee91 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2022 19:18:39 +0000 Subject: Remove TCL_TIMER_EVENTS and TCL_DONT_WAIT flags introduced in [e0e4d873] (see ticket [bfea11a916] discussing this on 2022-09-25 19:00:10). --- macosx/tkMacOSXEmbed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 2f04e74..6c411ab 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -1049,7 +1049,7 @@ EmbedGeometryRequest( */ Tk_GeometryRequest((Tk_Window)winPtr, width, height); - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} if ((winPtr->changes.width != width) || (winPtr->changes.height != height)) { EmbedSendConfigure(containerPtr); -- cgit v0.12 From 334520dd9bcd584d6b11f698a2daf9a1972977c4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Oct 2022 20:43:17 +0000 Subject: Revert previous commit, it does not seem to help in stabilizing the last non-reproducible tests failures on macOS with aqua (xcode or clang), i.e. unixEmbed-10.1, unixEmbed-10.2, and (font-47.2, font-47.3, frame-12.3, textImage-4.2, these four always happening simultaneously). --- macosx/tkMacOSXEmbed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 6c411ab..2f04e74 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -1049,7 +1049,7 @@ EmbedGeometryRequest( */ Tk_GeometryRequest((Tk_Window)winPtr, width, height); - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {} if ((winPtr->changes.width != width) || (winPtr->changes.height != height)) { EmbedSendConfigure(containerPtr); -- cgit v0.12 From fac20a34f64505188060e147b12ccb661cc9ca41 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Oct 2022 20:54:53 +0000 Subject: Temporarily restore previously existing constraints on unixEmbed-10.1 and unixEmbed-10.2, so that the branch can be merged. --- tests/unixEmbed.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 669ef40..80ea671 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1242,7 +1242,7 @@ test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constrain test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { - unix + unix failsOnUbuntu failsOnXQuarz } -setup { deleteWindows } -body { @@ -1257,7 +1257,7 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con deleteWindows } -result {150x80+0+0} test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { - unix + unix failsOnUbuntu failsOnXQuarz } -setup { deleteWindows } -body { -- cgit v0.12