in reply to Auto-adjust row height to line wrap in Tk-Tablematrix
Making no claim to understanding tcl; what the code appears to be doing is:
SOmething roughly equivalent in Perl terms to:
my $maxRows = $tableMatrix->cget( -rows ); my $maxCols = $tableMatrix->cget( -cols ); for my $r ( 1 .. $maxRows -1 ) { set $maxHeight = 1; for my $col ( 0 .. $maxCols - 1 ) { my $text = $tableMatrix->getText( -row => $row, -col => $col ) +; my $nLines = scalar split "\n", $text; if( $nLines > 1 and $maxHeight < $nLines ) { $maxHeight = $nLines; } } $tableMatrix->cset( row => $row, height => $maxHeight ); }
You'll have to work out the appropriate methods to call for what I've shown as getText() & cset().
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Auto-adjust row height to line wrap in Tk-Tablematrix
by elef (Friar) on Feb 09, 2013 at 15:22 UTC | |
by BrowserUk (Patriarch) on Feb 09, 2013 at 16:02 UTC | |
by elef (Friar) on Feb 09, 2013 at 18:15 UTC | |
by BrowserUk (Patriarch) on Feb 10, 2013 at 12:56 UTC | |
by elef (Friar) on Feb 10, 2013 at 15:04 UTC |