I'm not sure what you are trying to do, but maybe you are overcomplicating it by trying to use a Table. This was posted a few months ago by rcseege. Just add some header canvases.
#!/usr/bin/perl use strict; use Tk; use Tk::Pane; # by rcseege my $mw = MainWindow->new; my $sPane = $mw->Scrolled("Pane", -scrollbars => 'se', -sticky => 'nsew', -bg => 'black', -width => 300, -height => 300 )->pack(qw/-expand 1 -fill both/); my $container = $sPane->Subwidget('scrolled'); foreach my $row (0 .. 3) { foreach my $col (0 .. 3) { createTile($container, $row, $col); } } foreach my $i (0 .. 3) { $container->gridRowconfigure($i, -weight => 1); $container->gridColumnconfigure($i, -weight => 1); } MainLoop; ## Each 'Tile' is a Frame containing a Scrolled Canvas + ## another Frame containing zoom controls. sub createTile { my ($parent, $x, $y) = @_; my $tileColor = "black"; my $tile = $parent->Frame(-bg => $tileColor)->grid( -padx => 5, -pady => 5, -row => $x, -column => $y, -sticky => 'nsew' ); my $sc = $tile->Scrolled('Canvas', -scrollbars => 'osoe', -scrollregion => [0, 0, 200, 200], -width => 125, -height => 125, -background => randColor() )->pack(qw/-fill both -side top -expand 1/); my $count = int(rand(6)) + 2; foreach my $i (1 .. $count) { my ($x, $y) = (randNumber(), randNumber()); my $size = randNumber(); $sc->createRectangle($x, $y, $x+$size, $y+$size, -fill => randColor(), -outline => 'black', -width => 2 ); } my $bFrame = $tile->Frame(-bg => $tileColor)->pack(qw/-side top/); $bFrame->Button( -text => " Zoom Out ", -command => sub { $sc->scale(qw/all 0 0 .5 .5/); } )->pack(qw/-side left -padx 5/); $bFrame->Button( -text => " Zoom In", -command => sub { $sc->scale(qw/all 0 0 2 2/); } )->pack(qw/-side right -padx 5/); } sub randColor { my @colors = qw(red yellow blue orange green purple); return $colors[rand($#colors + 1)]; } sub randNumber { my ($max, $min) = (100, 10); my $size = int(rand($max)); $size += $min if $size < $min; return $size; }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re^3: Problem with scrolling Tk Table by zentara
in thread Problem with scrolling Tk Table by tcarmeli

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.