Tkinter Pack Method
Tkinter Pack Method
com
Advertisements
This geometry manager organizes widgets in blocks before placing them in the parent widget.
Syntax
widget.pack( pack_options )
• expand − When set to true, widget expands to fill any space not otherwise used in widget's parent.
• fill − Determines whether widget fills any extra space allocated to it by the packer, or keeps its own
minimal dimensions: NONE default , X fillonlyhorizontally , Y fillonlyvertically , or BOTH
fillbothhorizontallyandvertically .
• side − Determines which side of the parent widget packs against: TOP default , BOTTOM, LEFT,
or RIGHT.
Example
Try the following example by moving cursor on different buttons −
root = Tk()
frame = Frame(root)
frame.pack()
bottomframe = Frame(root)
bottomframe.pack( side = BOTTOM )
root.mainloop()