Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Arranging Frames in TK

by Tanalis (Curate)
on Jun 26, 2003 at 12:09 UTC ( [id://269207]=note: print w/replies, xml ) Need Help??


in reply to Arranging Frames in TK

There are various ways to lay out frames in a window. What I tend to do is to use frames to contain sets of widgets, and then simply pack() the frames onto the mainwindow. This provides the default packing, which is to stack the frames one after the other from the top of the window to the bottom.

If you'd like to do more than this, you can pack frames to one of the sides of the window. This is achieved as follows:

my $mw = new MainWindow; my $frame = $mw->Frame(); # do something with the frame $frame->pack(-side => 'left');
Here, side can take the values top, bottom, left or right, packing the frames to the respective side of the window. The default is 'top'.

Moving up a step, you can change the order that frames are packed in using the $frame->pack(-after => $otherframe); syntax. after may be replaced with before to have the opposite effect.

A multitude of other functionality for pack is available, without even mentioning the other layout managers. If you're likely to be using Tk a lot, I'd advise you get youself a good book on the subject (I'd recommend Learning Perl/Tk from O'Reilly).

Hope that helps a little.
-- Foxcub
#include www.liquidfusion.org.uk

Update: Typo correction (thanks herveus)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found