Skip to content

Commit

Permalink
Replace 'eval destroy ...' by 'destroy {*} ...'
Browse files Browse the repository at this point in the history
  • Loading branch information
fvogelnew1 committed Jan 7, 2024
1 parent 5e523d7 commit dcfcac9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion library/console.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ proc ::tk::ConsoleBind {w} {
tk::ConsoleInsert %W %A
}
bind Console <F9> {
eval destroy [winfo child .]
destroy {*}[winfo children .]
source -encoding utf-8 [file join $tk_library console.tcl]
}
if {[tk windowingsystem] eq "aqua"} {
Expand Down
2 changes: 1 addition & 1 deletion library/demos/widget
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exec wish "$0" ${1+"$@"}
package require Tk 8.5
package require msgcat

eval destroy [winfo child .]
destroy {*}[winfo children .]
set tk_demoDirectory [file join [pwd] [file dirname [info script]]]
::msgcat::mcload $tk_demoDirectory
namespace import ::msgcat::mc
Expand Down
4 changes: 2 additions & 2 deletions tests/color.test
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ test color-2.11 {Tk_GetColor, 6 hex digits, last one invalid} -body {
} -returnCodes error -result {invalid color name "#12345g"}

test color-3.1 {Tk_FreeColor procedure, reference counting} colorsFree {
eval destroy [winfo child .t]
destroy {*}[winfo children .t]
mkColors .t.c 40 6 0 240 240 0 -6 0 0 0 -40
pack .t.c
mkColors .t.c2 20 1 250 0 0 -10 0 0 0 0 0
Expand All @@ -223,7 +223,7 @@ test color-3.1 {Tk_FreeColor procedure, reference counting} colorsFree {
lappend result [colorsFree .t]
} {0 1}
test color-3.2 {Tk_FreeColor procedure, flushing stressed cmap information} colorsFree {
eval destroy [winfo child .t]
destroy {*}[winfo children .t]
mkColors .t.c 40 6 0 240 240 0 -6 0 0 0 -40
pack .t.c
mkColors .t.c2 20 1 250 0 0 -10 0 0 0 0 0
Expand Down
2 changes: 1 addition & 1 deletion tests/grid.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ proc grid_reset {{test ?} {top .}} {
gets stdin
}
}
eval destroy [winfo children $top]
destroy {*}[winfo children $top]
update
foreach {cols rows} [grid size .] {}
for {set i 0} {$i <= $cols} {incr i} {
Expand Down
2 changes: 1 addition & 1 deletion tests/ttk/ttk.test
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ test ttk-ensemble-5 "style element create: valid" -body {
ttk::style element create plain.background from default
} -returnCodes 0 -result ""

eval destroy [winfo children .]
destroy {*}[winfo children .]

tcltest::cleanupTests

Expand Down
42 changes: 21 additions & 21 deletions tests/unixEmbed.test
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constra
pack .f1 .f2
dobg "set w [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t -use $w
list [testembed] [expr [lindex [lindex [testembed all] 0] 0] - $w]
}
Expand Down Expand Up @@ -179,7 +179,7 @@ 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 .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
toplevel .t2 -use $w2
testembed
Expand Down Expand Up @@ -238,7 +238,7 @@ test unixEmbed-2.1 {EmbeddedEventProc procedure} -constraints {
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
testembed
}
Expand Down Expand Up @@ -283,7 +283,7 @@ test unixEmbed-2.2 {EmbeddedEventProc procedure} -constraints {
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
testembed
destroy .t1
Expand Down Expand Up @@ -351,7 +351,7 @@ test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} -constraints
dobg "set w1 [winfo id .f1]"
set x [testembed]
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
wm withdraw .t1
}
Expand Down Expand Up @@ -403,7 +403,7 @@ test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} -co
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1 -bd 2 -relief raised
update
wm geometry .t1 +30+40
Expand Down Expand Up @@ -447,7 +447,7 @@ test unixEmbed-3.4 {ContainerEventProc procedure, disallow position changes} -co
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
update
wm geometry .t1 300x100+30+40
Expand Down Expand Up @@ -491,7 +491,7 @@ test unixEmbed-3.5 {ContainerEventProc procedure, geometry requests} -constraint
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
update
Expand Down Expand Up @@ -534,7 +534,7 @@ test unixEmbed-3.6 {ContainerEventProc procedure, map requests} -constraints {
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
set x unmapped
bind .t1 <Map> {set x mapped}
Expand Down Expand Up @@ -584,7 +584,7 @@ test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints {
bind .f1 <Destroy> {set x dead}
set x alive
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
update
Expand Down Expand Up @@ -631,7 +631,7 @@ test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} -constraints
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
update
Expand Down Expand Up @@ -677,7 +677,7 @@ test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} -constraints {
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
update
Expand Down Expand Up @@ -723,7 +723,7 @@ test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} -constraints {
update
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
bind .t1 <FocusIn> {lappend x "focus in %W"}
bind .t1 <FocusOut> {lappend x "focus out %W"}
Expand Down Expand Up @@ -772,7 +772,7 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constrai
update
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
update
Expand Down Expand Up @@ -820,7 +820,7 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints {
update
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
bind .t1 <FocusIn> {lappend x "focus in %W"}
bind .t1 <FocusOut> {lappend x "focus out %W"}
Expand Down Expand Up @@ -876,7 +876,7 @@ test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} -constr
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
update
bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
Expand Down Expand Up @@ -922,7 +922,7 @@ test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} -constr
place .f1 -width 200 -height 200
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
update
bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
Expand Down Expand Up @@ -973,7 +973,7 @@ test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constrain
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
focus -force .
Expand Down Expand Up @@ -1036,7 +1036,7 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1
}
update
Expand Down Expand Up @@ -1102,7 +1102,7 @@ test unixEmbed-8.1 {TkpClaimFocus procedure} -constraints {
pack .f1 .f2
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
}
focus -force .f2
Expand Down Expand Up @@ -1204,7 +1204,7 @@ test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} -constraint
update
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
destroy {*}[winfo children .]
toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
set x {}
lappend x [testembed]
Expand Down

0 comments on commit dcfcac9

Please sign in to comment.