1
我使用以下函数从Tkinter的菜单中打开输入对话框。在子框架中管理命令Tkinter(Python)
def show_entry_fields(e):
global pwd
pwd = e.get()
def showPwdInputBox():
# display an input box for the password
c = Toplevel(root)
c.title("Enter your password")
c.geometry('200x160+230+130')
Label(c, text="Password").pack() #(row=0)
e1 = Entry(c, show="*")
e1.pack()
Button(c, text='OK', command= lambda: show_entry_fields(e1)).pack()
Button(c, text='Close', command=c.destroy).pack()
我需要在用户按下确定时关闭对话框。我怎样才能做到这一点?
更新....! @ TigerhawkT3 – dsgdfg
不知道为什么这是downvoted。有人会关心解释它有什么问题吗? – TigerhawkT3
朋友, 因为我不在乎打分。 – dsgdfg