I don't know whether it's worth the effort trying to grid such a complicated interaction. Here is a similar idea, on how to match up and link-scroll on a few canvases. Notice that by packing(instead of griding), it will auto-resize nicely.
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow(); $mw->geometry("600x400+200+200"); my $topframe = $mw->Frame(-bg=>'grey65')->pack(); my $infolab = $topframe->Label(-text =>'Some Info')->pack(); my $midframe = $mw->Frame(-bg=>'grey85')->pack(); my $midframel = $midframe->Frame(-bg=>'grey85')->pack(-side=>'left',-e +xpand=>1,-fill=>'y'); my $midframer = $midframe->Frame(-bg=>'grey85')->pack(-side=>'right'); my $botframe = $mw->Frame(-bg=>'grey85')->pack(); my $canvast = $midframer->Canvas( -bg =>'lightyellow', -width=>24000, -height=>25, -scrollregion=>[0,0,25000,1000], -xscrollincrement => 1, ) ->pack(-side=>'top'); my $canvasp = $midframer->Scrolled('Canvas', -bg =>'lightseagreen', -width=>24000, -height=>1000, -scrollregion=>[0,0,25000,1000], -scrollbars=>'se', #use the xscrollcommand in the subwidget instead # -xscrollcommand => \&xscrollit, -xscrollincrement => 1, -yscrollincrement => 1, ) ->pack(-side=>'bottom',-fill=>'both'); my $canvass = $midframel->Canvas( -bg =>'lightsteelblue', -width=>50, -height=>1000, -scrollregion=>[0,0,50,1000], -yscrollincrement => 1, ) ->pack(-side=>'top',-fill=>'both'); my $xscroll = $canvasp->Subwidget("xscrollbar"); my $yscroll = $canvasp->Subwidget("yscrollbar"); $xscroll->configure(-troughcolor =>'white', -activebackground =>'black', -command => \&xscrollit, ); $yscroll->configure(-troughcolor =>'white', -activebackground =>'black', -command => \&yscrollit, ); #create timebar and markers for(0..24000){ if( $_ % 100 == 0){ $canvast->createLine($_,0,$_,10); $canvast->createText($_,20,-text=>$_); next; } } for(0..24000){ if( $_ % 100 == 0){ $canvasp->createLine($_,0,$_,10); $canvasp->createText($_,20,-text=>$_); next; } } #create station boxes for(0..50){ $canvass->createRectangle(0,25+ $_*50, 50, 75 + $_*50, -fill =>'hotpink', ); } MainLoop; ###################################################################### +# sub xscrollit{ my $fraction = $_[1]; print "$fraction\n"; $canvast->xviewMoveto($fraction); $canvasp->xviewMoveto($fraction); } ###################################################################### sub yscrollit{ my $fraction = $_[1]; print "$fraction\n"; $canvass->yviewMoveto($fraction); $canvasp->yviewMoveto($fraction); } ######################################################################

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

In reply to Re: Tk:: How to do a pane which scrolls partially by zentara
in thread Tk:: How to do a pane which scrolls partially 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.