summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/messagebox.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tkinter/messagebox.py')
-rw-r--r--Lib/tkinter/messagebox.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/tkinter/messagebox.py b/Lib/tkinter/messagebox.py
index 5c35d5a..4a711fa 100644
--- a/Lib/tkinter/messagebox.py
+++ b/Lib/tkinter/messagebox.py
@@ -78,32 +78,39 @@ def _show(title=None, message=None, _icon=None, _type=None, **options):
# In others we get a Tcl_Obj.
return str(res)
+
def showinfo(title=None, message=None, **options):
"Show an info message"
return _show(title, message, INFO, OK, **options)
+
def showwarning(title=None, message=None, **options):
"Show a warning message"
return _show(title, message, WARNING, OK, **options)
+
def showerror(title=None, message=None, **options):
"Show an error message"
return _show(title, message, ERROR, OK, **options)
+
def askquestion(title=None, message=None, **options):
"Ask a question"
return _show(title, message, QUESTION, YESNO, **options)
+
def askokcancel(title=None, message=None, **options):
"Ask if operation should proceed; return true if the answer is ok"
s = _show(title, message, QUESTION, OKCANCEL, **options)
return s == OK
+
def askyesno(title=None, message=None, **options):
"Ask a question; return true if the answer is yes"
s = _show(title, message, QUESTION, YESNO, **options)
return s == YES
+
def askyesnocancel(title=None, message=None, **options):
"Ask a question; return true if the answer is yes, None if cancelled."
s = _show(title, message, QUESTION, YESNOCANCEL, **options)
@@ -113,6 +120,7 @@ def askyesnocancel(title=None, message=None, **options):
return None
return s == YES
+
def askretrycancel(title=None, message=None, **options):
"Ask if operation should be retried; return true if the answer is yes"
s = _show(title, message, WARNING, RETRYCANCEL, **options)