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
command assumes several forms. The syntactical options are as follows:
Option |
Interpretation |
---|---|
|
Behaves in the same manner as grid configure. |
|
Controls placement of the grid itself. Acceptable... |