From 1f5742674e81309bcdf849be98ee359a61d731a7 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 17 May 2023 17:32:58 -0400 Subject: [PATCH] gh-104499: IDLE - fix completions for tk aqua 8.7 --- Lib/idlelib/NEWS.txt | 2 ++ Lib/idlelib/autocomplete_w.py | 10 +++------- .../2023-05-17-17-32-21.gh-issue-104499.hNeqV4.rst | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2023-05-17-17-32-21.gh-issue-104499.hNeqV4.rst diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index f78e45e671c9e7..553b932aa6b6bc 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -4,6 +4,8 @@ Released on 2023-10-02 ========================= +gh-104499: Fix completions for Tk Aqua 8.7 (currently blank). + gh-104486: Make About print both tcl and tk versions if different, as is expected someday. diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 0f835a9cc1d010..5bd7ce7f5e5adb 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -182,16 +182,11 @@ def show_window(self, comp_lists, index, complete, mode, userWantsWin): self.userwantswindow = userWantsWin self.lasttypedstart = self.start - # Put widgets in place self.autocompletewindow = acw = Toplevel(self.widget) - # Put it in a position so that it is not seen. - acw.wm_geometry("+10000+10000") - # Make it float + acw.withdraw() acw.wm_overrideredirect(1) try: - # This command is only needed and available on Tk >= 8.4.0 for OSX - # Without it, call tips intrude on the typing process by grabbing - # the focus. + # Prevent grabbing focus on maxOS. acw.tk.call("::tk::unsupported::MacWindowStyle", "style", acw._w, "help", "noActivates") except TclError: @@ -271,6 +266,7 @@ def winconfig_event(self, event): # place acw above current line new_y -= acw_height acw.wm_geometry("+%d+%d" % (new_x, new_y)) + acw.deiconify() acw.update_idletasks() except TclError: pass diff --git a/Misc/NEWS.d/next/IDLE/2023-05-17-17-32-21.gh-issue-104499.hNeqV4.rst b/Misc/NEWS.d/next/IDLE/2023-05-17-17-32-21.gh-issue-104499.hNeqV4.rst new file mode 100644 index 00000000000000..20cbd9ab9e571f --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2023-05-17-17-32-21.gh-issue-104499.hNeqV4.rst @@ -0,0 +1 @@ +Fix completions for Tk Aqua 8.7 (currently blank).