def ask(): popup = Toplevel() ents = makeform(popup, fields) Button(popup, text='OK', command=(lambda: show(ents, popup))).pack() popup.grab_set() popup.focus_set() popup.wait_window()
def ask(): popup = Toplevel() # отобразить форму в виде модального диалога ents = makeform(popup, fields) Button(popup, text='OK', command=(lambda: show(ents, popup))).pack() popup.grab_set() popup.focus_set() popup.wait_window() # ждать закрытия окна
def ask(): popup = Toplevel() ents = makeform(popup, fields) btn = Button(popup, text='OK', command=(lambda: show(ents, popup))).pack(side=BOTTOM) popup.grab_set() popup.focus_set() popup.wait_window()
def ask(): popup = Toplevel() # show form in modal dialog window ents = makeform(popup, fields) Button(popup, text='OK', command=(lambda: show(ents, popup))).pack() popup.grab_set() popup.focus_set() popup.wait_window() # wait for destroy here
def ask(): popup = Toplevel() # 基于弹出窗口创建表单 ents = makeform(popup, fields) Button(popup, text='Ok', command=lambda: show(ents, popup)).pack() popup.grab_set() popup.focus_set() popup.wait_window() # 模态窗口,会阻止其它界面直至该窗口关闭
def ask(): popup = Toplevel() ents = makeform(popup, fields) Button(popup, text="OK", command=(lambda: show(ents, popup))).pack() popup.grab_set() popup.focus_set() popup.wait_window()
def ask(): ''' Creates the dialog and shows it as modal ''' popup = Toplevel() # show form in modal dialog window ents = makeform(popup, FIELDS) Button(popup, text='OK', command=(lambda: show(ents, popup))).pack() popup.grab_set() popup.focus_set() popup.wait_window() # wait for destroy here