我想打开一个顶层窗口然后关闭它,但要获取输入:
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()
这不起作用,因为未定义截止日期。我怎样才能做到这一点?就像我说的,这个想法是为输入打开一个弹出窗口,然后关闭它但保留输入。
一只甜甜圈
繁花不似锦
相关分类