Navigation Logo Geometry Management Navigation Logo

 

 

Online chapter from Tcl/Tk for Programmers (with exercises and solutions).

Geometry management is defined above in The Tk Way of Thinking. Review the concepts of "master," "parent," "slave," and "child" there if necessary.

Tk has three geometry managers: pack, grid, and place. Of these, place is the easiest to understand and the hardest to use. It is for those of you who want to do all your own geometry management work. If this is your desire, read about place in the on-line manual. The other two are covered here.

Any widget whose geometry is managed by Tk (rather than by the window manager) is a slave – there is some other window or widget of which it is a part. As far as the examples in this book show, that widget is both its master and its parent.

A widget can be both a master and a slave. It can even be a master with respect to one geometry manager and a slave with respect to another. It cannot be a slave to two masters. Also, do not try to make a widget a master with respect to two different geometry managers.

13.1 The pack and grid Action Families
13.2 Slicing
13.3 Slicing for Size Changes
13.4 Padding
13.5 An Array of Cells
13.6 The Cavity
13.7 Placing Widgets more Carefully
13.8 Tricks for Using Pack
13.9 Solutions to Exercises
 

 

[Sample TK Application]
Author's Home Page
Navigation Logo [Book's Cover]
Order from Amazon.