[Python-checkins] cpython: Issue #27620: Escape key closes Query box as cancelled.

terry.reedy python-checkins at python.org
Mon Jul 25 20:58:55 EDT 2016


https://hg.python.org/cpython/rev/352fc11b9fd2
changeset: 102452:352fc11b9fd2
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Mon Jul 25 20:58:43 2016 -0400
summary:
 Issue #27620: Escape key closes Query box as cancelled.
files:
 Lib/idlelib/idle_test/htest.py | 6 +++---
 Lib/idlelib/query.py | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py
--- a/Lib/idlelib/idle_test/htest.py
+++ b/Lib/idlelib/idle_test/htest.py
@@ -175,8 +175,8 @@
 "'' and file does not exist are invalid path items.\n"
 "Any url ('www...', 'http...') is accepted.\n"
 "Test Browse with and without path, as cannot unittest.\n"
- "A valid entry will be printed to shell with [0k]\n"
- "or <return>. [Cancel] will print None to shell"
+ "[Ok] or <Return> prints valid entry to shell\n"
+ "[Cancel] or <Escape> prints None to shell"
 }
 
 _io_binding_spec = {
@@ -245,7 +245,7 @@
 '_htest': True},
 'msg': "Enter with <Return> or [Ok]. Print valid entry to Shell\n"
 "Blank line, after stripping, is ignored\n"
- "Close dialog with valid entry, [Cancel] or [X]"
+ "Close dialog with valid entry, <Escape>, [Cancel], [X]"
 }
 
 
diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py
--- a/Lib/idlelib/query.py
+++ b/Lib/idlelib/query.py
@@ -53,6 +53,7 @@
 self.transient(parent)
 self.grab_set()
 self.bind('<Key-Return>', self.ok)
+ self.bind('<Key-Escape>', self.cancel)
 self.protocol("WM_DELETE_WINDOW", self.cancel)
 self.parent = parent
 self.message = message
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /