ghosh123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi
In my Tk gui application, there are three frames,namely $userframe (at the top), hlistframe (in the middle having HList object) and bottomframe (having a 'Display File' button on it). The problem is , when I contract the gui by holding and dragging the right-bottom corner, the bottomframe and also the button on it is disappearnig. Please help me how can I make both the bottomframe and the button to reduce proportionately so that they don't disappear.
Below is my code
use Tk; use Tk::HList; use Tk::ItemStyle; use Tk::BrowseEntry; my $mw = new MainWindow; $mw->title("View"); $mw->geometry("560x320"); my $userframe = $mw->Frame(-width=>5,-height=>10)->pack(-side=>'top',- +anchor=>'nw'); $userframe->Label(-text => "USER: $user")->pack(-side => 'left',-ancho +r => 'w',-padx => 0); $userframe->Label(-text => "Set time(sec)")->pack(-side => 'left',-anc +hor => 'w',-padx => 0); my $frequency = $userframe->Entry(-width=> 5,-textvariable=> \$sec)->p +ack(-side => 'left',-anchor => 'nw',-padx => 0); $userframe->Label(-text => "Select File")->pack(-side => 'left',-ancho +r => 'w',-padx => 0); $userframe->BrowseEntry( -state => 'normal', -choices => [keys %url], -variable => \$selectfile, -browsecmd => \&read_file, )->pack(-side=>'right',-anchor =>' +e'); my $hlistframe = $mw->Frame()->pack(-fill => 'both',-expand=>1); my $h +l; my $bottomframe = $mw->Frame()->pack(-fill => 'both', -expand => 1); $bottomframe->Button(-text => "Display File",-command => \&dumpOnTermi +nal)->pack(-side=>'right',-anchor => 'se',-fill=>'both'); my ($label1,$label2,$label3,$label4,$label5,$label6,$label7); $hl = $hlistframe->Scrolled('HList', -scrollbars => 'ose', -columns =>7 , -header => 1, -width => 100, -command => sub {print "AAA\n";}, )->pack(-fill => 'both',-expand =>1 ); $label1 = $hl->Label(-text => "Tool", -anchor => 'w'); $hl->headerCreate(0,-itemtype => 'window',-widget => $label1) ; $label2 = $hl->Label(-text => "Vendor", -anchor => 'w'); $hl->headerCreate(1,-itemtype => 'window',-widget => $label2); $label3 = $hl->Label(-text => "Available", -anchor => 'w'); $hl->headerCreate(2,-itemtype => 'window',-widget => $label3); $label4 = $hl->Label(-text => "num.", -anchor => 'w'); $hl->headerCreate(3,-itemtype => 'window',-widget => $label4); $label5 = $hl->Label(-text => "usage%", -anchor => 'w'); $hl->headerCreate(4,-itemtype => 'window',-widget => $label5); $label6 = $hl->Label(-text => "user", -anchor => 'w'); $hl->headerCreate(5,-itemtype => 'window',-widget => $label6); $label7 = $hl->Label(-text => "user%", -anchor => 'w'); $hl->headerCreate(6,-itemtype => 'window',-widget=> $label7); MainLoop;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl tk frame packing question
by stefbv (Curate) on Aug 17, 2013 at 15:41 UTC | |
by ghosh123 (Monk) on Aug 20, 2013 at 03:24 UTC | |
by stefbv (Curate) on Aug 20, 2013 at 05:58 UTC | |
by Anonymous Monk on Aug 20, 2013 at 07:59 UTC | |
by ghosh123 (Monk) on Aug 20, 2013 at 08:38 UTC | |
by stefbv (Curate) on Aug 20, 2013 at 10:13 UTC | |
by ghosh123 (Monk) on Aug 21, 2013 at 11:17 UTC | |
by stefbv (Curate) on Aug 21, 2013 at 13:27 UTC | |
by ghosh123 (Monk) on Aug 22, 2013 at 04:37 UTC | |
Re: perl tk frame packing question
by choroba (Cardinal) on Aug 17, 2013 at 15:47 UTC |
Back to
Seekers of Perl Wisdom