Options

The following options can be used with the pack and pack_configure methods:

Table 34-1. Pack Manager Options

Option

Type

Description

side

constant

Specifies which side to pack the widget against. To pack widgets vertically, use TOP (default). To pack widgets horizontally, use LEFT.

You can also pack widgets along the BOTTOM and RIGHT edges. You can mix sides in a single geometry manager, but the results may not be what you expect. While you can create pretty complicated layouts by nesting Frame widgets, you may prefer using the grid geometry manager for all non-trivial layouts.

fill

constant

Specifies whether the widget should occupy all the space given to it by the master. If NONE (default), keep the widget's original size. If X (horizontally), Y (vertically), or BOTH, fill the given space along that direction.

To make a widget fill the entire master widget, set fill to BOTH and expand to a non-zero value.

expand

flag

Specifies whether the widgets should be expanded to fill any extra space in the geometry master. If zero (default), the widget is not expanded.

in (in_)

widget

Pack widget inside the given widget. You can only pack a widget inside its parent, or in any decendant of its parent. This option should usually be left out, in which case the widget is packed inside its parent.

Note that in is a reserved word in Python. To use it as a keyword option, append an underscore (in_).