O'Reilly logo

Tcl/Tk 8.5 Programming Cookbook by Bert Wheeler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling layout with the grid command

Care must be taken in packing the widgets to ensure that the desired layout is obtained. The pack command provides a convenient method of geometry management for simple forms. However, for more complex forms, the grid command allows you to manage your widget placement by creating and configuring rows and columns for widget placement.

To illustrate this better, think of the grid as being similar to a table or a spreadsheet, as it contains rows and columns, as follows:

 

Column 0

Column 1

Column 2

Row 0

   

Row 1

   

Row 2

   

Please note that the column and row numbering are zero-based. This is the grid layout that we will use in the following example.

Based on the options provided, when invoked, the grid ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required