NateTut has asked for the wisdom of the Perl Monks concerning the following question:
sub DisplayChapter { my ($Chapter) = shift; my @ChapterText = GetChapter($Chapter); my $MaxLineLength = 0; foreach(@ChapterText) { if(length($_) > $MaxLineLength) { $MaxLineLength = length($_); } } my $GeometryString = ($MaxLineLength * 8) . 'x' . (scalar(@Chapter +Text) * 21); $mw->geometry($GeometryString); $mw->title(' ' x ((($MaxLineLength - 2) / 2) + 5) . (sprintf('%7s', + Number2Roman($Chapter)))); $OutputText->delete('1.0', 'end'); $text->tagConfigure(centered => -justify => 'center'); foreach my $Line (@ChapterText) { $text->insert('end', $Line, 'centered'); } $OutputText->pack(qw/-side bottom -fill both -expand 1/); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk Formatting
by keszler (Priest) on Oct 22, 2009 at 19:21 UTC | |
|
Re: Tk Formatting
by lamprecht (Friar) on Oct 22, 2009 at 21:41 UTC |