]> granicus.if.org Git - python/commitdiff
Issue #27620: Escape key closes Query box as cancelled.
authorTerry Jan Reedy <tjreedy@udel.edu>
Tue, 26 Jul 2016 00:58:43 +0000 (20:58 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Tue, 26 Jul 2016 00:58:43 +0000 (20:58 -0400)
Lib/idlelib/idle_test/htest.py
Lib/idlelib/query.py

index 4d98924d9b4f5b6f926c5a546769cc9e33fdb2a0..c59ed8c88ef9d01ce853e611ebb16af875186bca 100644 (file)
@@ -175,8 +175,8 @@ HelpSource_spec = {
            "'' 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 @@ Query_spec = {
              '_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]"
     }
 
 
index d2d1472a0e529a6f2f48f2dd5fca85641a9174a4..c4e2891f2594fd3cb977141f659eba42ac52ba5d 100644 (file)
@@ -53,6 +53,7 @@ class Query(Toplevel):
         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