我一直在浏览,我想根据标签中输入的内容动态调整活动Tkinter窗口的大小。
但是,如何根据返回的数据量动态调整此窗口的大小,如下所示。
My Current Tkinter设置;
#Create Window
root = Tk()
root.title("Customer Details")
#Resize Window
root.geometry("375x125+300+300")
#Creste Element frames
TopFrame = Frame(root)
TopFrame.pack()
MiddleFrame = Frame(root)
MiddleFrame.pack()
#Track load elements
View = Button(TopFrame, text='View',command=View, padx=15)
Cust = Entry(TopFrame, text="Waiting..", fg="black", justify='center')
View.pack(pady=5, fill=BOTH, side=RIGHT)
Cust.pack(side=LEFT)
CurrentStatus = Label(MiddleFrame, text="Waiting for customer!", fg="black", justify='left')
CurrentStatus.pack(fill=BOTH, expand=YES)
#Loop Window to make sure it doesn't disappear
root.mainloop()
任何帮助都会很棒,谢谢。