Just another Perl shrine | |
PerlMonks |
(ichi) Re: Tk Explanationby ichimunki (Priest) |
on Jun 03, 2002 at 21:55 UTC ( [id://171342]=note: print w/replies, xml ) | Need Help?? |
There are a few different ways to precisely position a widget in Tk. One would be to use a Canvas widget and then place all other widgets on that, but this is top-heavy. One would be to use the Pack geometry manager and very specifically tell each Pack method call how tall and wide to make each widget. Another would be to use the Grid geometry manager. Finally, there is Tk::place, which allows for fairly simple, yet exact control over widget size and placement. This one would be ideal if exactness is called for. But most of us use the Pack geometry manager because it helps us by appropriately sizing widgets based on contents and context. You have some pretty good documentation available already in the form of the widget demo (just type widget on a command line to run it), then there's perldoc Tk::Pack; perldoc Tk::Grid; perldoc Tk::place. To your second question: I've never thought a GUI builder for Tk to be that needed, but guido may fit the bill. It might be alpha-quality though, but it's a start. Being written in Perl/Tk it might offer some hints about good Perl/Tk programming, though. The book "Mastering Perl/Tk" is probably the book to get. Short of buying the book you could always download the code samples the book first.
In Section
Seekers of Perl Wisdom
|
|