Tkinter toplevel: Opening treeview to fit the frame
fill="both"
means "fill all the area that has been allocated to you". It is doing just that. The treeview widget has a certain height it wants to be, so pack allocates just enough space for it to fit. That leaves a lot of extra space that has not been allocated.
If you want the treeview to expand to fill all remaining space and not just the space that it needs, use the expand
option in addition to the fill
option.
Example:
tree.pack(fill="both", expand=True)