Hi, this is a pretty tricky one, because the scrolled Table acts weird to begin with, and you are trying to pack Scrolled Canvases into it's cells. I can only offer you are clue, because I believe it will take some experimenting to get it to work like you expect.

Put the Table (non-scrolled) into a Scrolled Pane. That will keep things visible. I don't know what your variable cell sizes will do in this setup, you may have to do some fancy callbacks, like reconfiguring the canvases' scrollregions after a mainwindow resize. Anyways..... think Scrolled Pane.

#!/usr/bin/perl -w use strict; use warnings; use Tk; use Tk::Table; require Tk::Pane; my $graph_width=300; my $graph_height=400; #my $graph_height=800; my $title_c; my $group; my $canvas; my $table; my @group_names=('A','B'); my $col=0; my $graph_win = MainWindow->new( ); $graph_win->withdraw; my $pane = $graph_win->Scrolled('Pane')->pack(-expand=>1,-fill=>'both' +); $table= $pane->Table( -rows => 2, -columns => 2, -scrollbars => 'e', -fixedrows => 1, -fixedcolumns => 0 )->pack( -expand => 1, -fill => 'both', ); foreach $group (@group_names){ $title_c=$table->Label( -text => $group, -relief => 'groove', -font => "{Arial} 15 bold", -borderwidth => 2, ); $table->put(0,$col, $title_c); $col++; } $col=0; foreach $group (@group_names){ $canvas = $table->Scrolled("Canvas", -scrollbars => 's', -width => 300, -height => $graph_height, -background => 'white', -borderwidth => 2, -relief => 'groove', -scrollregion => [0,0,$graph_width,$graph_height] ); $table->put(1,$col++, $canvas); } $graph_win->deiconify(); $graph_win->raise(); $graph_win->geometry('600x500+30+30'); MainLoop;

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

In reply to Re: 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.