From 71c0f7acbdb9d1e6054fdc5bb3b36e7027d8dd68 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Fri, 24 Apr 2020 18:57:52 -0600 Subject: [PATCH] bpo-27620: The escape key closes IDLE's config dialog as canceled --- Lib/idlelib/configdialog.py | 13 ++++++------- .../IDLE/2020-04-24-18-57-25.bpo-27620.gev438.rst | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2020-04-24-18-57-25.bpo-27620.gev438.rst diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 9d5c2cde04b..e701b4c76c5 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -80,11 +80,10 @@ class ConfigDialog(Toplevel): 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() @@ -174,7 +173,7 @@ class ConfigDialog(Toplevel): self.apply() self.destroy() - def apply(self): + def apply(self, event=None): """Apply config changes and leave dialog open. Methods: @@ -187,7 +186,7 @@ class ConfigDialog(Toplevel): self.save_all_changed_extensions() self.activate_config_changes() - def cancel(self): + def cancel(self, event=None): """Dismiss config dialog. Methods: @@ -202,7 +201,7 @@ class ConfigDialog(Toplevel): 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 00000000000..245be256d26 --- /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.