Tkinter space between widgets keeps growing

Viewed 88

I'm trying to get a paned widget to grow with a form but whenever I pull the window down vertically, the gap between the paned widget and the status bar grows.

from tkinter import *

root = Tk()

pw = PanedWindow(root, orient='horizontal')

red = LabelFrame(pw, text='red')
Label(red, text='something', anchor='w').grid(row=1, column=1)

blue = LabelFrame(pw, text='blue')
Label(blue, text='anything', anchor='w').grid(row=1, column=1)

pw.add(red, stretch='always')
pw.add(blue, stretch='always')

status = Label(root, text='Status', relief=SUNKEN)

pw.pack(expand=True, fill=BOTH)
status.pack(side=BOTTOM, expand=True, fill=X)

root.mainloop()

Is there a way of stopping the gap between the status bar and the bottom of the window and the gap between the status bar and the paned widget from growing?

1 Answers

To solve your issue I configured this line:

status.pack(side=BOTTOM, expand=False, fill=X,anchor='n')

For more information see.

Related