Skip to content

gh-71807: The escape key closes IDLE's config dialog as canceled #19706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Lib/idlelib/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<Escape>', self.Cancel) #dismiss dialog, no save
# self.bind('<Alt-a>', self.Apply) #apply changes, save
# self.bind('<F1>', self.Help) #context help
self.bind('<Escape>', self.cancel) # Dismiss dialog, no save
self.bind('<Alt-a>', self.apply) # Apply changes, save
self.bind('<F1>', self.help) # Context help
# Attach callbacks after loading config to avoid calling them.
tracers.attach()

Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The escape key now closes IDLE's config dialog as canceled.
Loading