Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5361e9a5
Commit
5361e9a5
authored
Nov 08, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #1351744: Add askyesnocancel helper for tkMessageBox.
parent
a346c092
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/lib-tk/tkMessageBox.py
Lib/lib-tk/tkMessageBox.py
+10
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/lib-tk/tkMessageBox.py
View file @
5361e9a5
...
...
@@ -102,6 +102,15 @@ def askyesno(title=None, message=None, **options):
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
)
# s might be a Tcl index object, so convert it to a string
s
=
str
(
s
)
if
s
==
CANCEL
:
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
)
...
...
@@ -119,4 +128,5 @@ if __name__ == "__main__":
print
"question"
,
askquestion
(
"Spam"
,
"Question?"
)
print
"proceed"
,
askokcancel
(
"Spam"
,
"Proceed?"
)
print
"yes/no"
,
askyesno
(
"Spam"
,
"Got it?"
)
print
"yes/no/cancel"
,
askyesnocancel
(
"Spam"
,
"Want it?"
)
print
"try again"
,
askretrycancel
(
"Spam"
,
"Try again?"
)
Misc/NEWS
View file @
5361e9a5
...
...
@@ -96,6 +96,8 @@ Core and builtins
Library
-------
- Patch #1351744: Add askyesnocancel helper for tkMessageBox.
- Patch #1060577: Extract list of RPM files from spec file in
bdist_rpm
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment