Perl Monk, Perl Meditation | |
PerlMonks |
Re: Arranging Frames in TKby Tanalis (Curate) |
on Jun 26, 2003 at 12:09 UTC ( [id://269207]=note: print w/replies, xml ) | Need Help?? |
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: 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.
Update: Typo correction (thanks herveus)
In Section
Seekers of Perl Wisdom
|
|