Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

(ichi) Re: Tk Explanation

by ichimunki (Priest)
on Jun 03, 2002 at 21:55 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found