Mercurial > cpython-lru_cache-weakref
annotate Lib/lib-tk/tkMessageBox.py @ 80661:94de77bd0b4b 2.7
Issue #16194: document imp.load_dynamic problems
when read several extension modules from the same binary object file.
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Thu, 29 Nov 2012 19:51:28 +0200 |
| parents | 79845e3d5cac |
| children |
| rev | line source |
|---|---|
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 # tk common message boxes |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 # this module provides an interface to the native message boxes |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 # available in Tk 4.2 and newer. |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 # written by Fredrik Lundh, May 1997 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 # options (all have default values): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 # - default: which button to make default (one of the reply codes) |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 # - icon: which icon to display (see below) |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
15 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 # - message: the message to display |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
17 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 # - parent: which window to place the dialog on top of |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
20 # - title: dialog title |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 # - type: dialog type; that is, which buttons to display (see below) |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
23 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
24 |
|
47240
05aa21d6dbeb
Fixed an import that remained from the lib-tk -> tkinter -> lib-tk renaming
Guilherme Polo <ggpolo@gmail.com>
parents:
47183
diff
changeset
|
25 from tkCommonDialog import Dialog |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
26 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
27 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 # constants |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
29 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 # icons |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 ERROR = "error" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
32 INFO = "info" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 QUESTION = "question" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
34 WARNING = "warning" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
35 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
36 # types |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
37 ABORTRETRYIGNORE = "abortretryignore" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
38 OK = "ok" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
39 OKCANCEL = "okcancel" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
40 RETRYCANCEL = "retrycancel" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
41 YESNO = "yesno" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
42 YESNOCANCEL = "yesnocancel" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
43 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
44 # replies |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
45 ABORT = "abort" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
46 RETRY = "retry" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
47 IGNORE = "ignore" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
48 OK = "ok" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
49 CANCEL = "cancel" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 YES = "yes" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
51 NO = "no" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
52 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
53 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
54 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
55 # message dialog class |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
56 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
57 class Message(Dialog): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
58 "A message box" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
59 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
60 command = "tk_messageBox" |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
61 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
62 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
63 # |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
64 # convenience stuff |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
65 |
|
38862
1258e93bb1d0
Patch #815924: Restore ability to pass type= and icon=
Martin v. Löwis <martin@v.loewis.de>
parents:
35858
diff
changeset
|
66 # Rename _icon and _type options to allow overriding them in options |
|
1258e93bb1d0
Patch #815924: Restore ability to pass type= and icon=
Martin v. Löwis <martin@v.loewis.de>
parents:
35858
diff
changeset
|
67 def _show(title=None, message=None, _icon=None, _type=None, **options): |
|
1258e93bb1d0
Patch #815924: Restore ability to pass type= and icon=
Martin v. Löwis <martin@v.loewis.de>
parents:
35858
diff
changeset
|
68 if _icon and "icon" not in options: options["icon"] = _icon |
|
1258e93bb1d0
Patch #815924: Restore ability to pass type= and icon=
Martin v. Löwis <martin@v.loewis.de>
parents:
35858
diff
changeset
|
69 if _type and "type" not in options: options["type"] = _type |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
70 if title: options["title"] = title |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
71 if message: options["message"] = message |
|
33512
11d4500be6fa
Convert boolean results back to strings. Fixes #807871.
Martin v. Löwis <martin@v.loewis.de>
parents:
28513
diff
changeset
|
72 res = Message(**options).show() |
|
59645
79845e3d5cac
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
Matthias Klose <doko@ubuntu.com>
parents:
47240
diff
changeset
|
73 # In some Tcl installations, yes/no is converted into a boolean. |
|
33512
11d4500be6fa
Convert boolean results back to strings. Fixes #807871.
Martin v. Löwis <martin@v.loewis.de>
parents:
28513
diff
changeset
|
74 if isinstance(res, bool): |
|
59645
79845e3d5cac
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
Matthias Klose <doko@ubuntu.com>
parents:
47240
diff
changeset
|
75 if res: |
|
79845e3d5cac
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
Matthias Klose <doko@ubuntu.com>
parents:
47240
diff
changeset
|
76 return YES |
|
33512
11d4500be6fa
Convert boolean results back to strings. Fixes #807871.
Martin v. Löwis <martin@v.loewis.de>
parents:
28513
diff
changeset
|
77 return NO |
|
59645
79845e3d5cac
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
Matthias Klose <doko@ubuntu.com>
parents:
47240
diff
changeset
|
78 # In others we get a Tcl_Obj. |
|
79845e3d5cac
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
Matthias Klose <doko@ubuntu.com>
parents:
47240
diff
changeset
|
79 return str(res) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
80 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
81 def showinfo(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
82 "Show an info message" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
83 return _show(title, message, INFO, OK, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
84 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
85 def showwarning(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
86 "Show a warning message" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
87 return _show(title, message, WARNING, OK, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
88 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
89 def showerror(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
90 "Show an error message" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
91 return _show(title, message, ERROR, OK, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
92 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
93 def askquestion(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
94 "Ask a question" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
95 return _show(title, message, QUESTION, YESNO, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
96 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
97 def askokcancel(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
98 "Ask if operation should proceed; return true if the answer is ok" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
99 s = _show(title, message, QUESTION, OKCANCEL, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
100 return s == OK |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
101 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
102 def askyesno(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
103 "Ask a question; return true if the answer is yes" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
104 s = _show(title, message, QUESTION, YESNO, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
105 return s == YES |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
106 |
|
40304
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
107 def askyesnocancel(title=None, message=None, **options): |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
108 "Ask a question; return true if the answer is yes, None if cancelled." |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
109 s = _show(title, message, QUESTION, YESNOCANCEL, **options) |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
110 # s might be a Tcl index object, so convert it to a string |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
111 s = str(s) |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
112 if s == CANCEL: |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
113 return None |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
114 return s == YES |
|
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
115 |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
116 def askretrycancel(title=None, message=None, **options): |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
117 "Ask if operation should be retried; return true if the answer is yes" |
|
28513
90c77b8af1a4
SF patch #701494: more apply removals
Raymond Hettinger <python@rcn.com>
parents:
5869
diff
changeset
|
118 s = _show(title, message, WARNING, RETRYCANCEL, **options) |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
119 return s == RETRY |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
120 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
121 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
122 # -------------------------------------------------------------------- |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
123 # test stuff |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
124 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
125 if __name__ == "__main__": |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
126 |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
127 print "info", showinfo("Spam", "Egg Information") |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
128 print "warning", showwarning("Spam", "Egg Warning") |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
129 print "error", showerror("Spam", "Egg Alert") |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
130 print "question", askquestion("Spam", "Question?") |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
131 print "proceed", askokcancel("Spam", "Proceed?") |
|
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
132 print "yes/no", askyesno("Spam", "Got it?") |
|
40304
bd1623d04bfc
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
Martin v. Löwis <martin@v.loewis.de>
parents:
38862
diff
changeset
|
133 print "yes/no/cancel", askyesnocancel("Spam", "Want it?") |
|
5869
f2bf7bcf8b8b
New dialog routines (Fred Lundh)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
134 print "try again", askretrycancel("Spam", "Try again?") |
