# This module has some routines that deal with resizing things. global bm set bm 2 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Get size info for a window or widget. proc GetWinfo w { global V me Winw WinW Winh WinH CC RR WW HH set id "$me/GetWinfo" set CC [$w cget -width] set RR [$w cget -height] set WW [winfo width $w] set HH [winfo height $w] if {$V>2} {puts "\n$id: $w is $CC x $RR chars ($WW x $HH pixels)."} set WinW($w) $WW set WinH($w) $HH set wbdw [lindex [$w config -borderwidth] 4] set hltn [lindex [$w config -highlightthickness] 4] set inbw [lindex [$w config -insertborderwidth] 4] set insw [lindex [$w config -insertwidth] 4] set padx [lindex [$w config -padx] 4] set pady [lindex [$w config -pady] 4] set slbw [lindex [$w config -selectborderwidth] 4] if {$V>2} {puts "\n$id: wbdw=$wbdw hltn=$hltn inbw=$inbw insw=$insw padx=$padx pady=$pady slbw=$slbw."} set Ww [expr {$WW-2*($wbdw+$hltn+$inbw+$insw+$padx+$slbw)}] set Wh [expr {$HH-2*($wbdw+$hltn+$inbw+$insw+$pady+$slbw)}] set Winw($w) $Ww set Winh($w) $Wh if {$V>4} {puts "$id: $w is now $WinW($w)/$Winw($w) pixels wide $WinH($w)/$Winh($w) pixels high."} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # At present, ResizeText is triggered when the top-level text widget (curD) # gets resized. What we have to do is hunt down any tables within the page, # and resize each of them to fit into the new width. For each of them, we in # turn need to resize any contained cells, some of which may contain tables. proc ResizeText {w} { global B V me bd Winw WinW Winh WinH Tf2c Tn2f N opt global TW TH Tw Th CW CH Cw Ch bm CC RR WW HH set id "$me/ResizeText" update if ![winfo exists $w] { Msg "ResizeText: $w doesn't exist!" return } GetWinfo $w if {$WW <= 1 || $HH <= 1} { if {$V>1} {puts "$id: Resize $w to ${WW}x${HH} pixels ignored."} return } if {$V>5} {puts "$id: WinW($w)=$WinW($w) WinH($w)=$WinH($w)"} switch $opt(TABLE) { 1 { if {$V>4} {puts "$id: tk $N(TABLE) ..."} if [info exists Tf2c($w)] { if {[set tbls $Tf2c($w)] < 1} { if {$V>1} {puts "$id: $w contains no tables."} return } if {$V>1} {puts "$id: $w contains tables {$tbls}"} GetWinfo $w foreach tn $tbls { set tw $Winw($w) if {$V>2} {puts "$id: Resize table $tn to width tw=$tw WW=$WW"} if [info exists Tn2f($tn)] { set tt $Tn2f($tn) if {$V>2} {puts "$id: Table $tn is \"$tt\""} if [winfo exists $tt] { if {$V>2} {puts "$id: Table $tn $tt resize to -width $tw ..."} ResizeTbl $tn $tw # $tt config -width $tw # after ${V}000 # if {$V>2} {puts "$id: Table $tn=$tt resized to -width $tw."} } else { if {$V>1} {puts "$id: ### Table $tn=$Tn2f($tn) does not exist ###"} } } else { if {$V>1} {puts "$id: ### Table $tn Tn2f($tn) not defined ###"} } } } else { puts "$id: $w contains no tables." } } 2 { if {$V>1} {puts "$id: tkTable $N(TABLE) ..."} if {!$N(tkTable)} {tkTableLib} Msg "$id: Resize not implemented yet for tkTable." } default { if {$V>1} {puts "$id: Ignored for opt(TABLE)=$opt(TABLE)."} } } if {$V>1} {puts "$id: Done\n"} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # This routine runs around in a text widget measuring things, and leaves # behind a set of hints about how the text would like to be sized. We get a # widget name w, which should have values in PicMinw, TxtMinw and TxtMaxw. We # return with the following defined: # TxtMinw($w) Min width, ignoring borders. # TxtMinW($w) Min width, counting borders. # TxtMaxw($w) Max width, ignoring borders. # TxtMaxW($w) Max width, counting borders. # The similarly-named variables that start with "Pic" refer to measurements # of the pictures contained within w, and should have been calculated as the # images were read in. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc MeasureDoc {w} { global B V me PicMinw PicMaxw curD Tf2c Tcols Trows Tn2f \ TxtFont TxtFnt0 TxtLen TxtMinw TxtMinW TxtMaxw TxtMaxW TxtMin WinW WinH global TW TH Tw Th CW CH Cw Ch bm set id "$me/MeasureDoc" if {$V>1} {puts "$id: $w <==========================="} if ![info exists PicMinw($w)] {set PicMinw($w) 0} if ![info exists PicMaxw($w)] {set PicMaxw($w) 0} if ![info exists TxtMinw($w)] {set TxtMinw($w) 0} if ![info exists TxtMaxw($w)] {set TxtMaxw($w) 0} if ![info exists TxtMinW($w)] {set TxtMinW($w) 0} if ![info exists TxtMaxW($curD)] {set TxtMaxW($curD) 0} if [info exists PicMinw($w)] { if {$V>2} {puts "$id: $w needs PicMinw=$PicMinw($w) pixels for an image."} set TxtMinw($w) [Max $TxtMinw($w) $PicMinw($w)] } if [info exists PicMaxw($w)] { if {$V>2} {puts "$id: $w uses PicMaxw=$PicMaxw($w) pixels for its images."} set TxtMaxw($w) [Max $TxtMaxw($w) $PicMaxw($w)] } set bd [lindex [$w config -bd] end] if {$V>2} {puts "$id: $w has TxtLen=$TxtLen($w) chars and PicMinw=$PicMinw($w) bd=$bd."} set TxtFont($w) [lindex [$w config -font] end] set TxtFnt0($w) [font measure $TxtFont($w) 0] if {$V>1} {puts "$id: Font TxtFont=\"$TxtFont($w)\" width TxtFnt0=$TxtFnt0($w) pixels."} set TxtMinw($w) [Max $TxtFnt0($w) $PicMinw($w)] set TxtMinW($w) [expr {$TxtMinw($w) + (2 * $bd)}] # set TxtMaxw($w) [expr {($TxtLen($w) * $TxtFnt0($w)) + $PicMaxw($w)}] set TxtMaxW($w) [expr {$TxtMaxw($w) + (2 * $bd)}] if {$V>1} {puts "$id: $w TxtMinw=$TxtMinw($w) TxtMaxw=$TxtMaxw($w) without border."} if {$V>1} {puts "$id: $w TxtMinW=$TxtMinW($w) TxtMaxW=$TxtMaxW($w) with border <-----------------."} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # This routine runs around in a table measureing things, and leaves behind a # set of hints about how the table would like to be sized. We get a table # number and a suggested total width. proc MeasureTbl {tn} { global B V me curD Tf2c Tcols Trows Tn2f TxtFont TxtFnt0 global PicMinw TxtLen TxtMinw TxtMaxw TxtMinW TxtMaxW TxtMin WinW WinH global ColMinw ColMaxw ColMinW ColMaxW global TW TH Tw Th CW CH Cw Ch bm set id "$me/MeasureTbl" if {$V>2} {puts "$id: Measuring table $tn ======================="} if {$V>2} {puts "$id: $curD contains TxtLen($curD)=$TxtLen($curD) chars."} set cols $Tcols($tn) set rows $Trows($tn) if {$V>2} {puts "$id: Table $tn has $cols cols $rows rows."} if {$cols < 1} {set cols 1} if {$rows < 1} {set rows 1} for {set c 1} {$c <= $cols} {incr c} { set ColMinw($c) 0; set ColMaxw($c) 0 set ColMinW($c) 0; set ColMaxW($c) 0 } if [info exists Tn2f($tn)] { if [winfo exists [set capt $Tn2f($tn).caption]] { if {$V>1} {puts "$id: Table $tn has a caption $capt"} grid config $capt -columnspan $cols if {$V>1} {puts "$id: Table $tn caption $capt now spans $cols columns."} } for {set r 1} {$r <= $rows} {incr r} { if {$V>1} {puts "$id: Measure row $r ..."} for {set c 1} {$c <= $cols} {incr c} { if {$V>2} {puts "$id: Measure row $r col $c."} set txt $Tn2f($tn).r${r}c${c}.d if ![winfo exists $txt] { if {$V>1} {puts "$id: $txt does not exist."} continue } set bd [lindex [$txt config -bd] end] set b2 [expr {2 * $bd}] if {$V>2} {puts "$id: Measure row $r col $c bd=$bd b2=$b2."} if ![info exists TxtLen($txt)] {set TxtLen($txt) 0} if {$V>2} {puts "$id: $txt now contains TxtLen($txt)=$TxtLen($txt) chars."} if ![info exists TxtMin($txt)] {set TxtMin($txt) 0} if ![info exists TxtMinw($txt)] {set TxtMinw($txt) 0} if ![info exists TxtMaxw($txt)] {set TxtMaxw($txt) 0} if ![info exists TxtMinW($txt)] {set TxtMinW($txt) [expr {$TxtMinw($txt)+$b2}]} if ![info exists TxtMaxW($txt)] {set TxtMaxW($txt) [expr {$TxtMaxw($txt)+$b2}]} if {$V>2} {puts "$id: Cell $txt has TxtLen=$TxtLen($txt) TxtMin=$TxtMin($txt)"} if {$V>2} {puts "$id: Cell $txt has TxtMinw=$TxtMinw($txt) TxtMaxw=$TxtMaxw($txt)"} if {$V>2} {puts "$id: Cell $txt has TxtMinW=$TxtMinW($txt) TxtMaxW=$TxtMaxW($txt)"} if [winfo exists $txt] { if {$V>2} {puts "$id: Row $r Col $c has ColMinw=$ColMinw($c) ColMaxw=$ColMaxw($c)"} if {$V>2} {puts "$id: Row $r Col $c has ColMinW=$ColMinW($c) ColMaxW=$ColMaxW($c)"} MeasureDoc $txt if {$V>2} {puts "$id: Row $r Col $c has ColMinw=$ColMinw($c) TxtMinw=$TxtMinw($txt)"} if {$V>2} {puts "$id: Row $r Col $c has ColMaxw=$ColMaxw($c) TxtMaxw=$TxtMaxw($txt)"} if {$V>2} {puts "$id: Row $r Col $c has ColMinW=$ColMinW($c) TxtMinW=$TxtMinW($txt)"} if {$V>2} {puts "$id: Row $r Col $c has ColMaxW=$ColMaxW($c) TxtMaxW=$TxtMaxW($txt)"} if {$ColMinw($c) < $TxtMinw($txt)} {set ColMinw($c) $TxtMinw($txt)} if {$ColMaxw($c) < $TxtMaxw($txt)} {set ColMaxw($c) $TxtMaxw($txt)} if {$ColMinW($c) < $TxtMinW($txt)} {set ColMinW($c) $TxtMinW($txt)} if {$ColMaxW($c) < $TxtMaxW($txt)} {set ColMaxW($c) $TxtMaxW($txt)} if {$V>2} {puts "$id: Row $r Col $c has ColMinw=$ColMinw($c) ColMaxw=$ColMaxw($c)"} if {$V>2} {puts "$id: Row $r Col $c has ColMinW=$ColMinW($c) ColMaxW=$ColMaxW($c)"} } else { if {$V>1} {puts "$id: $txt does not exist."} } } } } else { if {$V>1} {puts "$id: Tn2f($tn) not defined."} } } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Set the cell widget w to pixel width p. Since the cells are text objects, # # they want the width in chars. So we have to grovel around in the font stuff # # to figure out how many chars gives us p pixels of width. Sure would be nice # # if we could set a width by pixels. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc cellWidth {p w bd2 bd3} { global V me bd TxtFont TxtFnt0 set id "$me/cellWidth" if {$V>4} {puts "$id: p=$p w=$w bd2=$bd2 bd3=$bd3."} if ![info exists TxtFont($w)] {set TxtFont($w) [lindex [$w config -font] end]} if ![info exists TxtFnt0($w)] {set TxtFnt0($w) [font measure $TxtFont($w) 0]} set fw $TxtFnt0($w) set bw [expr {($bd2+$bd3)*2}] set pw [expr {($p-$bw)/$fw}] if {$V>4} {puts "$id: font is \"$TxtFont($w)\" font width $fw - bw=$bw gives $pw chars."} $w config -width $pw if {$V>4} {puts "$id: $w config -width $pw"} return [expr {$pw * $fw}] } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Resize a table tn to width Tw($tn) pixels. We apportion the width among the # # columns of the table, and tell each of the column widgets to resize # # themselves to their fair share. At present, our apportioning scheme is # # rather simple minded. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc ResizeTbl {tn tw} { global B BG V me bd ColMinW ColMinw ColMaxW ColMaxw Tf2c Tcols Trows Tn2b Tn2f \ TxtFont TxtFnt0 TxtLen TxtMin TxtMinW TxtMaxW WinW WinH global TW TH Tw Th CW CH Cw Ch bm set id "$me/ResizeTbl" if ![info exists Tn2f($tn)] { if {$V>1} {Msg "$id: ### Tn2f($tn) not defined ###"} return } set tbl $Tn2f($tn) set tbw [lindex [$tbl config -bd] end] if {$V>1} {puts "$id: Resize table $tn \"$tbl\" to $tw pixels."} if ![winfo exists BG($tbl)] {set BG($tbl) [lindex [$tbl config -background] 4]} $tbl config -background red if {$V>2} {puts "$id: Table $tn $tbl resize to -width $tw -bd $tbw"} set TW($tn) $tw set Tw($tn) [expr {$tw - 2 * $tbw}] if {$V>1} {puts "$id: Table $tn $tbl resize to TW=$TW($tn): Tw=$Tw($tn) + $tbw-pixel border."} MeasureTbl $tn if {$V>1} {puts "$id: Table $tn $tbl resize to TW=$TW($tn): Tw=$Tw($tn) + $tbw-pixel border."} if {$V>1} {puts "$id: Resizing table $tn to tw=$tw TW=$TW($tn) Tw=$Tw($tn) pixels wide."} if [info exists Tcols($tn)] {set cols $Tcols($tn)} else {set cols 1} if [info exists Trows($tn)] {set rows $Trows($tn)} else {set rows 1} if [info exists Tn2b($tn) ] {set brdr $Tn2b($tn) } else {set brdr 0} if {$V>1} {puts "$id: Table $tn has cols=$cols rows=$rows brdr=$brdr."} if {$cols < 1} {set cols 1} if {$rows < 1} {set rows 1} if {$brdr < 0} {set brdr 1} if {$V>1} {puts "$id: Table $tn has $cols cols $rows rows $brdr border."} set capt $Tn2f($tn).caption if [winfo exists $capt] { if {$V>1} {puts "$id: Table $tn has a caption $capt"} grid config $capt -columnspan $cols if {$V>1} {puts "$id: Table $tn caption $capt now spans $cols columns."} } set paddable 0; # Number of columns that can be widened. set ppc [expr {$tw / $cols}] if {$V>2} {puts "$id: Average of $ppc pixels per column."} if {$V>4} {puts "$id: Table $tn min widths ..."} set wtotal 0; # Width pixels allocated so far. for {set r 1} {$r <= $rows} {incr r} { if {$V>4} {puts "$id: Table $tn row $r ..."} set wtotal 0 for {set c 1} {$c <= $cols} {incr c} { set cel $tbl.r${r}c${c} set txt $cel.d if ![info exists bd($tbl)] {set bd($tbl) $bd(T1)}; set B1 $bd($tbl) if ![info exists bd($cel)] {set bd($cel) $bd(T2)}; set B2 $bd($cel) if ![info exists bd($txt)] {set bd($txt) $bd(T3)}; set B3 $bd($txt) if {$V>4} {puts "$id: Table $tn row $r column $c B1=$B1 B2=$B2 B3=$B3 ColMinw=$ColMinw($c)."} incr wtotal [cellWidth $ColMinw($c) $txt $B2 $B3] if {$V>4} {puts "$id: Table $tn row $r column $c wtotal=$wtotal."} } } if {$V>4} {puts "$id: Table $tn wtotal=$wtotal."} update if {$V>4} {puts "$id: Table $tn expand widths ..."} if {[set wleft [expr {$tw - $wtotal}]] > 0} { if {$V>4} {puts "$id: $wtotal of allowed $tw pixels used, $wleft left."} set xcols 0 for {set c 1} {$c <= $cols} {incr c} { if {$ColMaxw($c) <= $ColMinw($c)} { if {$V>4} {puts "$id: Table $tn col $c is at max width."} continue } else { if {$V>4} {puts "$id: Table $tn col $c can expand."} incr xcols } } if {$V>4} {puts "$id: Table $tn has $xcols columns that can expand."} for {set c 1} {$c <= $cols} {incr c} { if {$V>4} {puts "$id: Table $tn col $c ..."} if {$ColMaxw($c) <= $ColMinw($c)} { if {$V>4} {puts "$id: Table $tn col $c is at max width."} continue } set ppc [Min [expr {$wleft/$xcols}] $ColMaxw($c)] if {$V>4} {puts "$id: Table $tn col $c will use $ppc pixels of $wleft left."} for {set r 1} {$r <= $rows} {incr r} { set cel $tbl.r${r}c${c} set txt $cel.d if {$V>4} {puts "$id: Table $tn col $c row $r width wtotal=$wtotal."} if ![info exists TxtFont($txt)] {set TxtFont($txt) [lindex [$txt config -font] end]} if ![info exists TxtFnt0($txt)] {set TxtFnt0($txt) [font measure $TxtFont($txt) 0]} if {$V>4} {puts "$id: Font TxtFont=\"$TxtFont($txt)\" width $TxtFnt0($txt) pixels."} # set fw $TxtFnt0($txt) # set bw [expr {($B2+$B3)*2}] # if [info exists ColMaxW($c)] { # if {$ColMaxW($c) < $ppc} { # if {$V>4} {puts "$id: Change ppc to ColMaxW($c)=$ColMaxW($c) + bw=$bw."} # set ppc [expr {$ColMaxW($c)+$bw}] # } # } cellWidth $ppc $txt $B2 $B3 # set cw [expr {($ppc-$bw)/$fw}] } incr wleft -$ppc incr xcols -1 if {$V>4} {puts "$id: Table $tn col $c leaves $wleft pixels $xcols cols to expand."} } } if {$V>4} {puts "$id: Table $tn heights ..."} for {set c 1} {$c <= $cols} {incr c} { if {$V>4} {puts "$id: Table $tn col $c ..."} for {set r 1} {$r <= $rows} {incr r} { set cel $tbl.r${r}c${c} set txt $cel.d if {$V>4} {puts "$id: Table $tn col $c row $r width wtotal=$wtotal."} set th [lindex [$txt config -height] 4] if {$V>4} {puts "$id: Height of $txt is $th chars."} # while {[$txt bbox end-1c] != {} && $th > 1} { # incr th -1 # if {$V>4} {puts "$id: End of $txt visible; decrease height to $th."} # $txt config -height $th # update # } set tries 5; # Avoid infinite loops. while {[$txt bbox end-1c] == {} && $tries > 0} { incr th if {$V>4} {puts "$id: End of $txt not visible; increase height to $th."} $txt config -height $th update incr tries -1 } while {[$txt bbox end-1c] != {} && $th > 1} { incr th -1 if {$V>4} {puts "$id: End of $txt visible; decrease height to $th."} $txt config -height $th update } } } $tbl config -background $BG($tbl) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # global resizebyincr set resizebyincr 0; # Resize text cells by incrementing their size. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc ResizeY {cell} { global BG V me resizebyincr set id "$me/ResizeY" if ![winfo exists $cell] {Msg "$id: ### $cell disappeared!!! ###"; return} if ![info exists BG($cell)] {set BG($cell) [lindex [$cell config -background] 4]} $cell config -background yellow $cell config -height 1 if {$resizebyincr > 0} { if {$V>1} {puts "$id: $cell by increments."} update set cellhlim 100 set cellhght 1 if ![winfo exists $cell] {Msg "$id: ### $cell disappeared!! ###"; return} $cell config -height $cellhght for {set n 0} {$n < $cellhlim} {incr n} { if ![winfo exists $cell] {Msg "$id: ### $cell gone!!! ###"; return} set e0 [$cell bbox end] set e1 [$cell bbox end-1c] set e2 [$cell bbox end-2c] if {$V>1} {puts "$id: cellhght={$cellhght} e0={$e0} e1={$e1} e2={$e2}"} if {($e2 != {}) || ($e1 != {}) || ($e0 != {})} { if {$V>1 && $e0 != {}} {puts "$id: e0={$e0} ends expansion."} if {$V>1 && $e1 != {}} {puts "$id: e1={$e1} ends expansion."} if {$V>1 && $e2 != {}} {puts "$id: e2={$e2} ends expansion."} break } incr cellhght if ![winfo exists $cell] {Msg "$id: ### $cell gone!! ###"; return} $cell config -height $cellhght if {$V>1} {puts "$id: $cell config -height $cellhght"} update } } else { if {$V>1} {puts "$id: $cell via yview."} update if ![winfo exists $cell] {Msg "$id: ### $cell gone!!! ###"; return} set yv [$cell yview] set ch [lindex [$cell config -height] end] set top [lindex $yv 0] set bot [lindex $yv 1] if {$V>1} {puts "$id: $cell yview is now {$yv} top=$top bot=$bot height=$ch."} # if {$top == 0} { # if {$V>1} {puts "$id: Ignore invisible $cell has top=$top."} # return # } set n 0 set newh 1 while {$bot < 1.0} { if ![winfo exists $cell] {Msg "$id: ### $cell gone!! ###"; return} if {$V>1} {puts "$id: $cell adjust height because bot=$bot (expand)"} if {[incr n] >= 1000} { if {$V>1} {puts "$id: Abandon $cell with n=$n newh=$newh."} return } set hght [lindex [$cell config -height] end] if {$bot < 0.01} {set bot 0.90}; # Kludge for image bug if {$V>1} {puts "$id: $cell hght=$hght bot=$bot."} set newh [expr {int(($hght / $bot) + 0.95)}] if {$V>1} {puts "$id: $cell adjust height from $hght to $newh."} $cell config -height $newh update update idletasks if ![winfo exists $cell] {Msg "$id: ### $cell disappeared!! ###"; return} set yv [$cell yview] set top [lindex $yv 0] set bot [lindex $yv 1] if {$V>1} {puts "$id: $cell yview is now {$yv} top=$top bot=$bot."} } while {$bot >= 1.0} { if {$V>1} {puts "$id: $cell decr height because bot=$bot (decr)."} set hght [lindex [$cell config -height] end] if {$V>1} {puts "$id: $cell hght=$hght bot=$bot."} incr newh -1 if {$newh < 1} {break} if {$V>1} {puts "$id: $cell adjust height from $hght to $newh."} $cell config -height $newh update update idletasks if ![winfo exists $cell] {Msg "$id: ### $cell disappeared! ###"; return} set yv [$cell yview] set top [lindex $yv 0] set bot [lindex $yv 1] if {$V>1} {puts "$id: $cell yview is now {$yv} top=$top bot=$bot."} } while {$bot < 1.0} { if {$V>1} {puts "$id: $cell incr height because bot=$bot (incr)."} set hght [lindex [$cell config -height] end] if {$V>1} {puts "$id: $cell hght=$hght bot=$bot."} incr newh if {$V>1} {puts "$id: $cell adjust height from $hght to $newh."} $cell config -height $newh update update idletasks if ![winfo exists $cell] {Msg "$id: ### $cell disappeared ###"; return} set yv [$cell yview] set top [lindex $yv 0] set bot [lindex $yv 1] if {$V>1} {puts "$id: $cell yview is now {$yv} top=$top bot=$bot."} } } $cell config -background $BG($cell) if {$V>1} {puts "$id: $cell resized.\n"} }