summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterryjreedy <tjreedy@udel.edu>2017-07-11 05:58:04 (GMT)
committerGitHub <noreply@github.com>2017-07-11 05:58:04 (GMT)
commit5b62b35e6fcba488da2f809965a5f349a4170b02 (patch)
treea469cb9d2e6bc1cbe565928cbb5e88d490f305db
parent64e461be09e23705ecbab43a8b01722186641f71 (diff)
downloadcpython-5b62b35e6fcba488da2f809965a5f349a4170b02.zip
cpython-5b62b35e6fcba488da2f809965a5f349a4170b02.tar.gz
cpython-5b62b35e6fcba488da2f809965a5f349a4170b02.tar.bz2
bpo-30870: IDLE -- fix logic error in eae2537. (#2660)
-rw-r--r--Lib/idlelib/configdialog.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py
index cf5bea7..6dc075f 100644
--- a/Lib/idlelib/configdialog.py
+++ b/Lib/idlelib/configdialog.py
@@ -157,7 +157,9 @@ class ConfigDialog(Toplevel):
frame_font_name, justify=LEFT, text='Font Face :')
self.fontlist = Listbox(
frame_font_name, height=5, takefocus=FALSE, exportselection=FALSE)
- self.fontlist.bind('<<ListboxSelect>>', self.on_fontlist_select)
+ self.fontlist.bind('<ButtonRelease-1>', self.on_fontlist_select)
+ self.fontlist.bind('<KeyRelease-Up>', self.on_fontlist_select)
+ self.fontlist.bind('<KeyRelease-Down>', self.on_fontlist_select)
scroll_font = Scrollbar(frame_font_name)
scroll_font.config(command=self.fontlist.yview)
self.fontlist.config(yscrollcommand=scroll_font.set)
@@ -973,7 +975,8 @@ class ConfigDialog(Toplevel):
Event can result from either mouse click or Up or Down key.
Set font_name and example display to selection.
"""
- font = self.fontlist.get(ANCHOR if event.type == 3 else ACTIVE)
+ font = self.fontlist.get(
+ ACTIVE if event.type.name == 'KeyRelease' else ANCHOR)
self.font_name.set(font.lower())
self.set_font_sample()