TL; DR: fill="both" .
, , . expand=true , . fill "x" , , . "y", , , , fill="both".
"x", "y", , . : " ", , , fill=both, .
, , . , , , , , :
import Tkinter as tk
root = tk.Tk()
sidebar = tk.Frame(root, width=200, bg='white', height=500, relief='sunken', borderwidth=2)
sidebar.pack(expand=False, fill='both', side='left', anchor='nw')
mainarea = tk.Frame(root, bg='#CCC', width=500, height=500)
mainarea.pack(expand=True, fill='both', side='right')
root.mainloop()
, , . , , .
import Tkinter as tk
root = tk.Tk()
sidebar = tk.Frame(root, width=200, bg='white', height=500, relief='sunken', borderwidth=2)
sidebar.pack(expand=True, fill='both', side='left', anchor='nw')
mainarea = tk.Frame(root, bg='#CCC', width=500, height=500)
mainarea.pack(expand=True, fill='both', side='right')
root.mainloop()
- expand=true expand=False. , . true, , , true. , , , , . fill="both". fill , , ( ), , , .