Skip to content

Commit 953e527

Browse files
authored
[3.6] bpo-30870: IDLE -- fix logic error in eae2537. (GH-2660) (#2661)
(cherry picked from commit 5b62b35)
1 parent 82a9075 commit 953e527

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/idlelib/configdialog.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def create_page_font_tab(self):
157157
frame_font_name, justify=LEFT, text='Font Face :')
158158
self.fontlist = Listbox(
159159
frame_font_name, height=5, takefocus=FALSE, exportselection=FALSE)
160-
self.fontlist.bind('<<ListboxSelect>>', self.on_fontlist_select)
160+
self.fontlist.bind('<ButtonRelease-1>', self.on_fontlist_select)
161+
self.fontlist.bind('<KeyRelease-Up>', self.on_fontlist_select)
162+
self.fontlist.bind('<KeyRelease-Down>', self.on_fontlist_select)
161163
scroll_font = Scrollbar(frame_font_name)
162164
scroll_font.config(command=self.fontlist.yview)
163165
self.fontlist.config(yscrollcommand=scroll_font.set)
@@ -973,7 +975,8 @@ def on_fontlist_select(self, event):
973975
Event can result from either mouse click or Up or Down key.
974976
Set font_name and example display to selection.
975977
"""
976-
font = self.fontlist.get(ANCHOR if event.type == 3 else ACTIVE)
978+
font = self.fontlist.get(
979+
ACTIVE if event.type.name == 'KeyRelease' else ANCHOR)
977980
self.font_name.set(font.lower())
978981
self.set_font_sample()
979982

0 commit comments

Comments
 (0)