Skip to content

Commit 71c0f7a

Browse files
committed
bpo-27620: The escape key closes IDLE's config dialog as canceled
1 parent 0e80b56 commit 71c0f7a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Lib/idlelib/configdialog.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ def __init__(self, parent, title='', *, _htest=False, _utest=False):
8080
self.transient(parent)
8181
self.protocol("WM_DELETE_WINDOW", self.cancel)
8282
self.fontpage.fontlist.focus_set()
83-
# XXX Decide whether to keep or delete these key bindings.
8483
# Key bindings for this dialog.
85-
# self.bind('<Escape>', self.Cancel) #dismiss dialog, no save
86-
# self.bind('<Alt-a>', self.Apply) #apply changes, save
87-
# self.bind('<F1>', self.Help) #context help
84+
self.bind('<Escape>', self.cancel) # Dismiss dialog, no save
85+
self.bind('<Alt-a>', self.apply) # Apply changes, save
86+
self.bind('<F1>', self.help) # Context help
8887
# Attach callbacks after loading config to avoid calling them.
8988
tracers.attach()
9089

@@ -174,7 +173,7 @@ def ok(self):
174173
self.apply()
175174
self.destroy()
176175

177-
def apply(self):
176+
def apply(self, event=None):
178177
"""Apply config changes and leave dialog open.
179178
180179
Methods:
@@ -187,7 +186,7 @@ def apply(self):
187186
self.save_all_changed_extensions()
188187
self.activate_config_changes()
189188

190-
def cancel(self):
189+
def cancel(self, event=None):
191190
"""Dismiss config dialog.
192191
193192
Methods:
@@ -202,7 +201,7 @@ def destroy(self):
202201
self.grab_release()
203202
super().destroy()
204203

205-
def help(self):
204+
def help(self, event=None):
206205
"""Create textview for config dialog help.
207206
208207
Attributes accessed:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The escape key now closes IDLE's config dialog as canceled.

0 commit comments

Comments
 (0)