我想打開一個(gè)頂層窗口然后關(guān)閉它,但要獲取輸入:def popupDeadline():
newWindow = Toplevel()
newWindow.geometry("290x100+300+300")
newWindow.configure(bg='#ffffff')
newWindow.resizable(height=False, width=False)
labelFrame = Label(newWindow, text="Enter Deadline (YYYY-MM-DD)")
labelFrame.place(x=50, y=10)
labelFrame.configure(bg='#ffffff')
deadlined=StringVar()
d1=Entry(newWindow,textvariable=deadlined)
d1.config(width=40)
d1.place(x=50, y=30, width=200, height=20)
btn = Button(newWindow, text="Enter", command=save_quit)
btn.place(x=50, y=50, width=100, height=20)和:def save_quit():
deadline = deadlined.get()這不起作用,因?yàn)槲炊x截止日期。我怎樣才能做到這一點(diǎn)?就像我說的,這個(gè)想法是為輸入打開一個(gè)彈出窗口,然后關(guān)閉它但保留輸入。
從第二個(gè) tkinter 窗口獲取數(shù)據(jù)
慕尼黑5688855
2023-05-23 15:04:06