Hi
Thanks Jack for the example.
here is where the problem i am encountering.
In your example the Left Frame was declared with -expand => 0:
my $frameLeft = $mainFrame->Frame( -bg=>'red',-borderwidth => 1, -width =>
50, )->pack( -side => 'left', -expand => 0, -fill => 'y');
expand = 0 implies it will not expand to fill available space right?
yet when I execute it, it did what I want to do.
Naturally, I would code it with expand = 1, fill = 'y'
Accordingly, this should fill only the vertical and not horizontal. And
when I did so, its not doing what I want it.
This is where I am very confused!!!
Anyway, assuming I want is to have a Frame "clerk.right".
And in this frame, I want to divide it into 5 namely: North, South, West,
East and X
The N, S, are top/bottom border with predefined height of 50.
the W, E are Left, Right border with predefined width of 50 also.
the rest is X and X (yellow) is to occupy the whole remaining frame.
###################################
use Tk;
my $mw = MainWindow->new( );
$mw->minsize();
$TK{'clerk.right'} = $mw->Frame( )->pack( -side => 'right', -expand => 1,
-fill => 'both');
$TK{'clerk.N'} = $TK{'clerk.right'}->Frame( -height => 50, -background =>
'blue' )->pack( -side => 'top', -expand => 1, -fill => 'x');
$TK{'clerk.S'} = $TK{'clerk.right'}->Frame( -height => 50, -background =>
'green' )->pack( -side => 'bottom', -expand => 1, -fill => 'x');
$TK{'clerk.W'} = $TK{'clerk.right'}->Frame( -width => 50, -background =>
'red' )->pack( -side => 'left', -expand => 0, -fill => 'y');
$TK{'clerk.X'} = $TK{'clerk.right'}->Frame( -background =>
'yellow')->pack( -side => 'left', -expand => 1, -fill => 'both');
$TK{'clerk.E'} = $TK{'clerk.right'}->Frame( -width => 50, -background =>
'black' )->pack( -side => 'left', -expand => 0, -fill => 'y');
MainLoop;
###################################
The result is that the Frame X is just a thin horizontal line!
its not occupying the whole remaining space.
This code isnt doing what I want it to.
Where is my Error here?
Dan
On Sat, Aug 1, 2009 at 1:52 AM, Jack <[email protected]> wrote:
> Again - sorry for the top post..
>
> I'm not completely sure of what you want, but I think you want some sort of
> "bar" down the left side. You have to turn the expand option to off for
> that
> to "not" allocate anymore space in the x direction on a resize. Otherwise
> the packer will split it 50/50 with the righthand frame.
>
> This will do what I describe - which is yet to be decided what you really
> want:
>
> #############################
> use Tk;
> use strict;
>
> my $mw=tkinit;
> my $mainFrame = $mw->Frame()->pack(-expand=>1, -fill => 'both');
> my $frameLeft = $mainFrame->Frame( -bg=>'red',-borderwidth => 1, -width =>
> 50, )->pack( -side => 'left', -expand => 0, -fill => 'y');
> my $frameRight = $mainFrame->Frame( -bg=>'yellow', -borderwidth => 1,
> )->pack( -side => 'left', -expand => 1, -fill => 'both');
>
> MainLoop;
> #############################
>
> Suggestion..it would be easier to help if you provided fully working
> programs that show the problem as opposed to code snippets (which had some
> typos).
>
> Jack
>
>
>
> ________________________________
>
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Daniel Burgaud
> Sent: July-31-09 4:52 AM
> To: Perl-Win32-Users
> Subject: problem with Tk Frame not filling the whole frame.
>
>
> Hi,
>
> I have a Frame and within this Frame, I have 2 more Frames:
>
> $mainFrame = $mw->Frame()->pack(-expand=>1, fill = 'both');
>
> $frameLeft = $mainFrame->Frame( -borderwidth => 1, width => 50, )->pack(
> -side => 'left', -expand => 1, -fill => 'y');
> $frameRight = $mainFrame->Frame( -borderwidth => 1, )->pack( -side =>
> 'right', -expand => 1, -fill => 'both');
>
>
> How come the sub frames isnt filling the whole mainFrame?
> Why? What option/method must I use to force these two sub frames to fill
> the
> mainFrame?
>
> I also tried it within a Notebook (instead of main Frame) with same effect:
>
> $mainFrame = $TK{'notebook'}->add('item', -label => ' Main Frame ');
> $frameLeft = $mainFrame->Frame( -borderwidth => 1, width => 50, )->pack(
> -side => 'left', -expand => 1, -fill => 'y');
> $frameRight = $mainFrame->Frame( -borderwidth => 1, )->pack( -side =>
> 'right', -expand => 1, -fill => 'both');
>
> Need Help. Thanks!
>
> Dan
>
>
>
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs