The Tkinter Pack Class

Pack (class) [#]

Pack geometry manager. This is an implementation class; all the methods described below are available on all widget classes.

pack(**options) [#]

Pack the widget as described by the options.

Geometry options.
Where the widget is placed inside the packing box. Default is CENTER.
Specifies whether the widgets should be expanded to fill any extra space in the geometry master. If false (default), the widget is not expanded.
Specifies whether the widget should occupy all the space provided to it by the master. If NONE (default), keep the widget’s original size. If X (fill horizontally), Y (fill 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.
Pack this 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_).
Internal padding. Default is 0.
Internal padding. Default is 0.
External padding. Default is 0.
External padding. Default is 0.
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 always be what you expect. While you can create pretty complicated layouts by nesting Frame widgets, you may prefer using the grid geometry manager for non-trivial layouts.

pack_configure(**options) [#]

Same as pack.

pack_forget() [#]

Removes the widget from its current manager. The widget is not destroyed, and can be displayed again by pack or any other manager.

pack_info() [#]

Returns a dictionary containing the current packer options.

A dictionary mapping packer option names to option values.

pack_propagate(flag) [#]

(Manager method) Controls geometry propagation. If enabled, the manager widget will be resized if not large enough to hold all the child widgets.

Note that this method should be called on the master widget, not on an invidivual child widget.

pack_slaves() [#]

(Manager method) Returns a list of all child (“slave”) widgets managed by the packer for this widget.

Note that this method should be called on the master widget, not on an invidivual child widget.

A list of child widgets.


A Django site. rendered by a django application. hosted by webfaction.