Skip to content

bpo-30870: IDLE -- fix logic error in eae2537. #2660

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

Merged
merged 1 commit into from
Jul 11, 2017
Merged
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
7 changes: 5 additions & 2 deletions Lib/idlelib/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ def create_page_font_tab(self):
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)
Expand Down Expand Up @@ -973,7 +975,8 @@ def on_fontlist_select(self, event):
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()

Expand Down