I will mention that a Scrolled Pane is far preferable to a Scrolled Frame. I would switch to a scrolled Pane for your main container, before you go much further. Frames are very crude containers, and I don't know if they can be resized without a packForget and repack. What you might want to do limit the scrollregions, instead of attempting a resize, if that makes any sense to you.
Here is a simple scrolled Pane example:
#!/usr/bin/perl use strict; use Tk; use Tk::Pane; my $mw = MainWindow->new; $mw->geometry('400x250'); my $mwf = $mw->Scrolled('Pane', -scrollbars=>'osoe', -sticky=>'nwse', )->pack(-expand=>1, -fill=>'both'); my $f1 = $mwf->Frame()->pack(-expand=>1,-fill=>'both'); my $f2 = $mwf->Frame()->pack(-expand=>1,-fill=>'both'); my %canv; for (0..4){ $canv{$_}{'obj'} = $f1->Scrolled('Canvas', -height => 100, -width => 100, -bg =>'white', -scrollbars => 'osoe', -scrollregion => [ 0, 0, 500, 500 ], )->pack(-side =>'left' ,-padx=>10,-pady=>10, -expand=>1, -fill=>'bo +th'); $canv{$_}{'obj'}->createText(50,50, -text => $_, -anchor => 'center', ); } for (5..9){ $canv{$_}{'obj'} = $f2->Scrolled('Canvas', -height => 100, -width => 100, -bg =>'white', -scrollbars => 'osoe', -scrollregion => [ 0, 0, 500, 500 ], )->pack(-side =>'left', -padx=>10,-pady=>10 ,-expand=>1, -fill=>'bo +th'); $canv{$_}{'obj'}->createText(50,50, -text => $_, -anchor => 'center', ); } MainLoop();
In reply to Re: Unable to resize embedded frame in perl/Tk
by zentara
in thread Unable to resize embedded frame in perl/Tk
by nikwasi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |