diff options
author | treectrl <treectrl> | 2006-11-19 00:51:46 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-11-19 00:51:46 (GMT) |
commit | 8131aeeb28373fc0a0686f5affa6b42d7a77bcde (patch) | |
tree | 66fd6208be1a5d7ca7602892d19217a7fa2390c8 /demos/style-editor.tcl | |
parent | 39d25658913b770cc093d4b90767ccc572ac2f92 (diff) | |
download | tktreectrl-8131aeeb28373fc0a0686f5affa6b42d7a77bcde.zip tktreectrl-8131aeeb28373fc0a0686f5affa6b42d7a77bcde.tar.gz tktreectrl-8131aeeb28373fc0a0686f5affa6b42d7a77bcde.tar.bz2 |
Use lassign instead of the classic foreach hack.
Diffstat (limited to 'demos/style-editor.tcl')
-rw-r--r-- | demos/style-editor.tcl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/demos/style-editor.tcl b/demos/style-editor.tcl index ebb2cce..2bbd589 100644 --- a/demos/style-editor.tcl +++ b/demos/style-editor.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: style-editor.tcl,v 1.12 2006/11/15 23:50:59 treectrl Exp $ +# RCS: @(#) $Id: style-editor.tcl,v 1.13 2006/11/19 00:55:51 treectrl Exp $ namespace eval StyleEditor { variable Info @@ -697,7 +697,7 @@ proc StyleEditor::StyleToCanvas {{scroll 0}} { foreach E [$Tdemo style elements $style] { $T element create $E [$Tdemo element type $E] foreach list [$Tdemo element configure $E] { - foreach {name x y default current} $list {} + lassign $list name x y default current $T element configure $E $name $current } } @@ -746,7 +746,7 @@ proc StyleEditor::StyleToCanvas {{scroll 0}} { foreach E [$Tdemo item style elements $I $C] { foreach list [$Tdemo item element configure $I $C $E] { - foreach {name x y default current} $list {} + lassign $list name x y default current set masterDefault [$Tdemo element cget $E $name] set sameAsMaster [string equal $masterDefault $current] if {!$sameAsMaster && ![string length $current]} { @@ -767,8 +767,7 @@ if 0 { # Do this after creating styles so -defaultstyle works foreach list [$Tdemo configure] { if {[llength $list] == 2} continue - foreach {name x y default current} $list {} - + lassign $list name x y default current $T configure $name $current } } |