Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by tybalt89 (Monsignor)
on Jul 16, 2018 at 13:44 UTC ( [id://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 (Scribe) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 01:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found