Geometry Managers

A geometry manager helps you place the widgets in the proper locations within their containers onscreen. (If you are a Java programmer, you are more familiar with the term layout manager.) This job is more complex than it sounds, because of variations in widget size and shape, text justification, alignment, and so on. It is complicated further by the fact that the calculations must be performed again if the window is resized.

Every GUI system has some kind of geometry management, and there often is more than one kind. Tk, in fact, has three: grid, place, and pack (which you've seen briefly).

The grid method views the window as being divided into rows and columns, like a table or a spreadsheet. It is roughly analogous to Java's ...

Get Sams Teach Yourself Ruby in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.