Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Tk::grid -sticky option not stretching frames

by tybalt89 (Parson)
on Jul 16, 2018 at 13:44 UTC ( #1218572=note: print w/replies, xml ) Need Help??


in reply to Tk::grid -sticky option not stretching frames

#!/usr/bin/perl # https://perlmonks.org/?node_id=1218559 use strict; use warnings; use Tk; use Tk::LabFrame; #use Tk::Treeplus; use Tk::ErrorDialog; my $mw = MainWindow->new(); my $gridOrPack="grid"; #"pack"; #my $gridOrPack="pack"; #my $tpFrame; #my $butFrame; my $tpFrame=$mw->LabFrame(-label=>'TreePlusFrame'); my $butFrame=$mw->LabFrame(-label=>'ButtonFrame'); if ($gridOrPack=~/grid/i) { $tpFrame->grid(-row=>1, -column=>1, -sticky=>'nsew'); $butFrame->grid(-row=>2, -column=>1, -sticky=>'nsew'); $mw->gridRowconfigure( 1, -weight => 1 ); $mw->gridRowconfigure( 2, -weight => 1 ); $mw->gridColumnconfigure( 1, -weight => 1 ); } else { $tpFrame->pack(-side=>'top',-expand=>1,-fill=>'both'); $butFrame->pack(-side=>'top',-expand=>1, -fill=>'both'); } $tpFrame->Label(-text=>'I like pack better')->pack(-side=>'top'); $butFrame->Button( -text => 'Exit', -command => sub { exit(0) }, ) ->pack(qw(-side bottom -pady 10)); MainLoop();

Replies are listed 'Best First'.
Re^2: Tk::grid -sticky option not stretching frames
by boleary (Beadle) on Jul 16, 2018 at 13:55 UTC

    Thankyou gracious tybalt89! I've not used the gridRowconfigure gridColumnconfigure methods before but that sure fixes my problem!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1218572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2020-01-26 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?