Artifact
c34411c91dde7ebaad8dfaa0ee08e063aad7924c:
Attachment "dicttest2.tcl" to
ticket [1938032fff]
added by
beric
2008-04-09 01:36:18.
proc refresh {items params} {
set paramsChild $params
set padding 25
dict incr paramsChild level
dict incr paramsChild y $padding
dict incr paramsChild x $padding
foreach child $items {
set resultChild [refresh $child $paramsChild]
dict incr paramsChild y [expr { $padding + [dict get $resultChild h] }]
dict with params {
if { $w + $x < [dict get $resultChild w] + [dict get $resultChild x] } {
set w [expr {[dict get $resultChild w] + [dict get $resultChild x] - $x}]
}
if { $h + $y < [dict get $resultChild h] + [dict get $resultChild y] } {
set h [expr {[dict get $resultChild h] + [dict get $resultChild y] - $y}]
}
incr h $padding
}
}
dict incr params w $padding
return $params
}
set a {}
set b [list $a]
set c [list $b $b]
set p [refresh $c {level 0 x 0 y 0 w 10 h 20}]
puts $p