本文整理汇总了Python中tkinter.messagebox.askquestion方法的典型用法代码示例。如果您正苦于以下问题:Python messagebox.askquestion方法的具体用法?Python messagebox.askquestion怎么用?Python messagebox.askquestion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.messagebox
的用法示例。
在下文中一共展示了messagebox.askquestion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MessageBox
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import askquestion [as 别名]
def MessageBox(self, type, Message):
self.type = type
self.Message = Message
if self.type=="error":
TkMessagebox.showerror(self.title,self.Message)
elif self.type=="yn":
return TkMessagebox.askquestion(self.title, self.Message,icon="warning")
else:
TkMessagebox.showinfo(self.title,self.Message)
return 0
示例2: new_game_confirm
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import askquestion [as 别名]
def new_game_confirm(self):
result = messagebox.askquestion("Start a new game", "Are you sure you want to start a new game ? Your current campaign will be overriden and there is no going back !", icon='warning')
if result == 'yes':
self.proceed_to_new_game_menu()
else:
pass
示例3: ask_question
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import askquestion [as 别名]
def ask_question(self, title, message):
return messagebox.askquestion(title, message)
示例4: __init__
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import askquestion [as 别名]
def __init__(self):
super().__init__()
self.create_button(mb.askyesno, "Ask Yes/No",
"Returns True or False")
self.create_button(mb.askquestion, "Ask a question",
"Returns 'yes' or 'no'")
self.create_button(mb.askokcancel, "Ask Ok/Cancel",
"Returns True or False")
self.create_button(mb.askretrycancel, "Ask Retry/Cancel",
"Returns True or False")
self.create_button(mb.askyesnocancel, "Ask Yes/No/Cancel",
"Returns True, False or None")