]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104499: IDLE - fix completions for tk aqua 8.7 (#104591)
authorTerry Jan Reedy <tjreedy@udel.edu>
Thu, 18 May 2023 01:36:58 +0000 (21:36 -0400)
committerGitHub <noreply@github.com>
Thu, 18 May 2023 01:36:58 +0000 (21:36 -0400)
Lib/idlelib/NEWS.txt
Lib/idlelib/autocomplete_w.py
Misc/NEWS.d/next/IDLE/2023-05-17-17-32-21.gh-issue-104499.hNeqV4.rst [new file with mode: 0644]

index f78e45e671c9e726d79a3ad55c75c87396204026..553b932aa6b6bcae32e372683a7d32bd87f655fe 100644 (file)
@@ -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.
 
index 0f835a9cc1d010b29fbb4f21f1d107a90bf6b6f7..5bd7ce7f5e5adb9475c0aeae089f0187a34a2e38 100644 (file)
@@ -182,16 +182,11 @@ class AutoCompleteWindow:
         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 @@ class AutoCompleteWindow:
                 # 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 (file)
index 0000000..20cbd9a
--- /dev/null
@@ -0,0 +1 @@
+Fix completions for Tk Aqua 8.7 (currently blank).