Resizing widgets (2)

Solution: combine the expand and fill options to pack:
text.pack(expand=1, fill='both')
# all parent widgets as well:
top.pack(side='top', expand=1, fill='both')
expand allows the widget to expand, fill tells in which directions the widget is allowed to expand
Try fileshow1.py and fileshow2.py!
Resizing is important for text, canvas and list widgets

previousnexttable of contents