Controlling layout with the pack command
Tk provides three methods of geometry management—pack
, grid
, and the rarely used place
command. We will be covering the pack
and grid
commands. The pack
command is the basic geometry manager for Tk. When invoked, the pack
command instructs the packer to arrange the widgets as specified. The packer is a geometry manager that arranges the elements of a window in order around the edges. In the following examples, we will see how to use the pack
command.
Based on the options provided when invoked the pack
command assumes several forms. The syntactical options are as follows:
Option |
Interpretation |
---|---|
|
Behaves in the same manner as |
|
This command accepts one or more widgets and pairs of options (if desired) to manage the pack.
|