]> granicus.if.org Git - python/commitdiff
[3.6] bpo-30870: IDLE -- fix logic error in eae2537. (GH-2660) (#2661)
authorterryjreedy <tjreedy@udel.edu>
Tue, 11 Jul 2017 06:16:41 +0000 (02:16 -0400)
committerGitHub <noreply@github.com>
Tue, 11 Jul 2017 06:16:41 +0000 (02:16 -0400)
(cherry picked from commit 5b62b35)

Lib/idlelib/configdialog.py

index cf5bea7ec7ece67b09a579cc4409bcf85d548278..6dc075fbadadf2d17c030de274b2bfd958b1bf6e 100644 (file)
@@ -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()