Not sure I really follow what it looks like - maybe some ascii art
would have helped. :)
I'm thinking 'grid' at the moment, possibly a frame containing a
grid of text widgets would handle most of what you need.
I used something like that to make a calendar for the year (actually
a grid of 12 text widgets (with dynamic sizing of rows and columns
so you could make it taller or wider based on a commandline switch)
and each containing an 8x7 matrix of text (1 month):
2012 CALENDAR
JANUARY ...
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
I had an entry widget below the calendar where you could change the
year and have it redraw the calendar for the new year.
Sample code for creating my calendar grid (won't work as is without
the rest of the code, but should get the idea across):
my $mw = new MainWindow;
# create calendar title hdr - eg: 2012 Calendar - text added later
$hdr = $mw->Label(
-justify => 'center',
-font => '-*-Arial-Medium-R-Normal--*-240-*-*-*-*-*-*',
-height => 1,
)->pack;
# create a frame with a grid of text widgets
my $lf1 = $mw->Frame(-relief => 'ridge')->pack(-fill => 'both', -expand => 1);
# create 12 'month' text boxes
for (my $ii = 0; $ii < 12; ++$ii) {
my $num = sprintf "%02u", $ii;
my $et = "\$t$num = \$lf1->Text(" .
"-font => '-*-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*', " .
"-width => $line_len," .
"-height => $lines_per_month);";
eval $et; # dynamically size the widgets
DLOG "TextBox ($ii) '$et'\n";
if ($@) { LOG "Textbox eval failed ($@)\n"; die; }
}
# form into grid dynamically using length/width ratio argument $months_per_row
# eg: months_per_row = rows x cols - 6=6x2, 4=4x3, 3=3x4, 2=2x6
for (my $ii = 0; $ii < 12; ++$ii) {
my $n = sprintf "%02u", $ii; # grid square widget number
my $r = int ($ii / $months_per_row); # rows
my $c = $ii - ($r * $months_per_row); # cols
my $et = "Tk::grid(\$t$n, -row => $r, -column => $c, -sticky => 'e');";
eval $et; # dynamically create the grid
DLOG "Grid ($ii) '$et'\n";
if ($@) { LOG "Grid eval failed ($@)\n"; die; }
};
The week lines were just a matter of figuring out which day numbers go in
which columns and create each line and insert into the proper text widget
in the correct row (after the 2 header lines).
I'm no Tk expert, but hopefully it gets you going or gives you an idea.