Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

(ichi) Re: Tk Explanation

by ichimunki (Priest)
on Jun 03, 2002 at 21:55 UTC ( #171342=note: print w/replies, xml ) Need Help??

in reply to Tk Explanation

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2016-10-22 06:56 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.