diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 8e478d743fb767..dfb233e5622dc8 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -80,11 +80,10 @@ def __init__(self, parent, title='', *, _htest=False, _utest=False): self.transient(parent) self.protocol("WM_DELETE_WINDOW", self.cancel) self.fontpage.fontlist.focus_set() - # XXX Decide whether to keep or delete these key bindings. # Key bindings for this dialog. - # self.bind('', self.Cancel) #dismiss dialog, no save - # self.bind('', self.Apply) #apply changes, save - # self.bind('', self.Help) #context help + self.bind('', self.cancel) # Dismiss dialog, no save + self.bind('', self.apply) # Apply changes, save + self.bind('', self.help) # Context help # Attach callbacks after loading config to avoid calling them. tracers.attach() @@ -176,14 +175,15 @@ def ok(self): self.apply() self.destroy() - def apply(self): - """Apply config changes and leave dialog open.""" + def apply(self, event=None): + """Apply config changes and leave dialog open. + """ self.deactivate_current_config() changes.save_all() self.extpage.save_all_changed_extensions() self.activate_config_changes() - def cancel(self): + def cancel(self, event=None): """Dismiss config dialog. Methods: @@ -198,7 +198,7 @@ def destroy(self): self.grab_release() super().destroy() - def help(self): + def help(self, event=None): """Create textview for config dialog help. Attributes accessed: diff --git a/Misc/NEWS.d/next/IDLE/2020-04-24-18-57-25.bpo-27620.gev438.rst b/Misc/NEWS.d/next/IDLE/2020-04-24-18-57-25.bpo-27620.gev438.rst new file mode 100644 index 00000000000000..245be256d26264 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2020-04-24-18-57-25.bpo-27620.gev438.rst @@ -0,0 +1 @@ +The escape key now closes IDLE's config dialog as canceled.