janusmccarthy has asked for the wisdom of the Perl Monks concerning the following question:

OK, I've created a Frame and in it I have an ROText Object and an empty southern frame.
ROText:
SouthFrame:

The ROText and the Frame have been packed.

After this has occurred, I want to add an Entry object in the SouthFrame of my frame and I want the SouthFrame to be below the ROText via addToSouthFrame. However, every time I do this, it adds the entry objects to the right of the ROText, in the south part of the window.

There's plenty of room for it to go full south. Should I repack after adding the Entry objects? In what order?

Here's the full wrapping the Frame in question, any "Labeled" things you see there are just my version of a Lab<Whatever> widget:

As always, any help is GREATLY appreciated

package EnhancedComponentFrame; use strict; use Tk; use LabeledButtonBox; use HashedLabeledListbox; use LabeledReadOnlyText; use LabeledEntry; ############################################### # A EnhancedComponentFrame is a component that # takes a LabeledComponent and adds a # LabeledButtonBox to the right, and # left justified LabeledComponent containers # to the north and south ############################################### ## # new - Creates a new EnhancedComponentFrame Object # # @param objectname The name of the object you want to create # @param type The type of component to create # @param title The title for this object # @param parent The parent container for this object # @param data The data for this object # # @returns - A new EnhancedComponentFrame ## sub new { #When any sub is called, it gets passed a list of parameters. These p +arams # are automatically stored in the list @_. my $frame; my $component; my $buttonBox; my $northFrame; my $southFrame; #Sets all the variables at once my ($class, $type, $title, $parent, $data) = @_; $frame = $parent->Frame(); $component = new $type( "$title", $frame, $data); $component->setData( $data); my $componentFrame = $component->getFrame(); $componentFrame->pack( -side => 'left', -fill => 'both', -expand => 1); $buttonBox = new LabeledButtonBox( "", $frame); $componentFrame = $buttonBox->getFrame(); $componentFrame->pack( -side => 'right', -fill => 'y'); $northFrame = $frame->Frame(); $northFrame->pack( -side => 'top', -fill => 'both'); $southFrame = $frame->Frame(); $southFrame->pack( -side => 'bottom', -fill => 'both'); my ($self) = { "PARENT" => $parent, "COMPONENT" => $component, "COMPONENTFRAME" => $component->getFrame(), "BUTTONBOX" => $buttonBox, "NORTHFRAME" => $northFrame, "SOUTHFRAME" => $southFrame, "NORTHITEMS" => (), "SOUTHITEMS" => (), "FRAME" => $frame }; bless ($self, $class); return $self; } ## # Returns the LabeledButtonBox on the right side # # @returns the LabeledButtonBox on the right side ## sub getButtonBox { my $self = shift; return $self->{ "BUTTONBOX"}; } ## # Returns the LabeledComponent on the left side # # @returns the LabeledComponent on the left side ## sub getComponent { my $self = shift; return $self->{ "COMPONENT"}; } ## # Adds an item to the north frame # # @param type The type of component to create # @param title The title for this object # @param data The data for this object ## sub addToNorthFrame { my $self = shift; my ($type, $title, $data) = @_; my $frame = $self->{ "NORTHFRAME" }; my $component = $type->new($title, $frame, $data); } ## # Adds an item to the north frame # # @param type The type of component to create # @param title The title for this object # @param data The data for this object ## sub addToSouthFrame { my $self = shift; my ($type, $title, $data) = @_; my $frame = $self->{ "SOUTHFRAME" }; my $component = $type->new($title, $frame, $data); # $self->{ "COMPONENTFRAME" }->pack(-side => 'left', # -fill => 'both'); # $self->{ "SOUTHFRAME" }->pack(-side => 'bottom', # -fill => 'x'); # $self->{ "NORTHFRAME" }->pack(-side => 'top', # -fill => 'x'); # $self->{ "COMPONENTFRAME" }->pack(); # $self->{ "SOUTHFRAME" }->pack(); # $self->{ "NORTHFRAME" }->pack(); # $self->{ "FRAME" }->pack(); } ## # Packs the components frame # # @options options for the pack ## sub pack { my $self = shift; $self->{ "FRAME" }->pack( @_); } 1;
Nevermind, I solved it, basically, I just changed the order of the original pack. I created the north and south panels first, then added the big panel. I'm a dork.