in reply to Tk geometry problem with pack

#!/usr/bin/perl -- use strict; use warnings; use Tk; use Tk::ProgressBar; TheAnonymous(); TheAnonymousMonk(); sub TheAnonymous { use Tk; my $mw = tkinit; my $bf = $mw->Frame( -bg => 'pink', -height, 150 ) ->pack( qw/ -side bottom -fill x / ); my $tf = $mw->Frame( -bg => 'lightgreen', -height, 150 ) ->pack( qw/ -side top -fill x / ); $mw->Label( -text, 'Hit tab space , tab space , tab space , tab sp +ace' ) ->pack; $tf->Button( -text => 'center', -command => [ \&TheToggle, 2, $bf +] ) ->pack( qw/ -anchor center / ); $tf->Button( -text => 'left', -command => [ \&TheToggle, 0, $bf ] +) ->pack( qw/ -side left / ); $tf->Button( -text => 'right', -command => [ \&TheToggle, 1, $bf ] + ) ->pack( qw/ -side right / ); $bf->Pane( -bg => 'blue', )->pack( qw/ -side left / ); $bf->Pane( -bg => 'green', )->pack( qw/ -side right / ); $bf->Pane( -bg => 'red', )->pack( qw/ -anchor center / ); $mw->withdraw; $mw->geometry( '480x480' ); $mw->deiconify; $mw->focusForce; $mw->MainLoop; } ## end sub TheAnonymous sub TheAnonymousMonk { use Tk; my $mw = tkinit; my $bf = $mw->Frame( -bg => 'pink', -height, 150 ) ->pack( qw/ -side bottom -fill x / ); my $tf = $mw->Frame( -bg => 'lightgreen', -height, 150 ) ->pack( qw/ -side top -fill x / ); $mw->Label( -text, 'Hit tab space , tab space , tab space , tab sp +ace' ) ->pack; $tf->Button( -text => 'center', -command => [ \&TheToggle, 2, $bf +] ) ->pack( qw/ -anchor center / ); $tf->Button( -text => 'left', -command => [ \&TheToggle, 0, $bf ] +) ->pack( qw/ -side left / ); $tf->Button( -text => 'right', -command => [ \&TheToggle, 1, $bf ] + ) ->pack( qw/ -side right / ); $bf->Pane( -bg => 'blue', )->pack( qw/ -side left -expand 1 -fill +both / ) ->Label( -text, -left )->pack; $bf->Pane( -bg => 'green', ) ->pack( qw/ -side right -expand 1 -fill both / )->Label( -text, + -right ) ->pack; $bf->Pane( -bg => 'red', ) ->pack( qw/ -anchor center -expand 1 -fill both / ) ->Label( -text, -center )->pack; $mw->withdraw; $mw->geometry( '480x480' ); $mw->deiconify; $mw->focusForce; $mw->MainLoop; } ## end sub TheAnonymousMonk sub TheToggle { my( $kidid, $parent ) = @_; my $kid = ( $parent->children )[$kidid]; if( my %info = eval { $kid->packInfo } ) { delete $info{-in}; $kid->{"\0_packInfo"} = \%info; $kid->packForget; $parent->packPropagate; } else { $kid->pack( %{ delete $kid->{"\0_packInfo"} } ); } } ## end sub TheToggle