diff --git a/library/console.tcl b/library/console.tcl index 83723f15f..d73b2f5c8 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -595,7 +595,7 @@ proc ::tk::ConsoleBind {w} { tk::ConsoleInsert %W %A } bind Console { - eval destroy [winfo child .] + destroy {*}[winfo children .] source -encoding utf-8 [file join $tk_library console.tcl] } if {[tk windowingsystem] eq "aqua"} { diff --git a/library/demos/widget b/library/demos/widget index 13b8d0eb7..b37c70cf7 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -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 diff --git a/tests/color.test b/tests/color.test index 5b8c5d236..fe92aaf11 100644 --- a/tests/color.test +++ b/tests/color.test @@ -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 @@ -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 diff --git a/tests/grid.test b/tests/grid.test index 4a03cff95..89897cafd 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -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} { diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index f25a852e2..fb7f47b94 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -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 diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 27cb97412..6f09564f9 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -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] } @@ -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 @@ -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 } @@ -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 @@ -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 } @@ -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 @@ -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 @@ -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 @@ -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 {set x mapped} @@ -584,7 +584,7 @@ test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints { bind .f1 {set x dead} set x alive dobg { - eval destroy [winfo child .] + destroy {*}[winfo children .] toplevel .t1 -use $w1 } update @@ -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 @@ -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 @@ -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 {lappend x "focus in %W"} bind .t1 {lappend x "focus out %W"} @@ -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 @@ -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 {lappend x "focus in %W"} bind .t1 {lappend x "focus out %W"} @@ -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 {lappend x {configure .t1 %w %h}} @@ -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 {lappend x {configure .t1 %w %h}} @@ -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 . @@ -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 @@ -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 @@ -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]