Posted to tcl by GPS at Fri Dec 14 09:55:12 GMT 2007view raw

  1. proc NS__grid-layout-xy {grid xsizesvar ysizesvar} {
  2. upvar $xsizesvar xsizes
  3. upvar $ysizesvar ysizes
  4.  
  5. foreach row $grid {
  6. foreach cells $row {
  7. foreach w $cells {
  8. if {"" eq $w} continue
  9. lassign [$w -slot] xslot yslot
  10. set x 0; set y 0
  11. for {set xi 0} {$xi < $xslot} {incr xi} {
  12. if {[info exists xsizes($xi)]} { incr x $xsizes($xi) }
  13. }
  14. for {set yi 0} {$yi < $yslot} {incr yi} {
  15. if {[info exists ysizes($yi)]} {incr y $ysizes($yi) }
  16. }
  17. $w x $x y $y
  18. }
  19. }
  20. }
  21. }
  22.