[3.11] gh-104499: IDLE - fix completions for tk aqua 8.7 (GH-104591) (#104596)

gh-104499: IDLE - fix completions for tk aqua 8.7 (GH-104591)
(cherry picked from commit 678bf57ed0)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Miss Islington (bot) 2023-05-17 19:02:53 -07:00 committed by GitHub
parent a8fc8b7e81
commit e96fb399c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View file

@ -4,6 +4,8 @@ Released after 2022-10-24
========================= =========================
gh-104499: Fix completions for Tk Aqua 8.7 (currently blank).
gh-104486: Make About print both tcl and tk versions if different, gh-104486: Make About print both tcl and tk versions if different,
as is expected someday. as is expected someday.

View file

@ -182,16 +182,11 @@ class AutoCompleteWindow:
self.userwantswindow = userWantsWin self.userwantswindow = userWantsWin
self.lasttypedstart = self.start self.lasttypedstart = self.start
# Put widgets in place
self.autocompletewindow = acw = Toplevel(self.widget) self.autocompletewindow = acw = Toplevel(self.widget)
# Put it in a position so that it is not seen. acw.withdraw()
acw.wm_geometry("+10000+10000")
# Make it float
acw.wm_overrideredirect(1) acw.wm_overrideredirect(1)
try: try:
# This command is only needed and available on Tk >= 8.4.0 for OSX # Prevent grabbing focus on maxOS.
# Without it, call tips intrude on the typing process by grabbing
# the focus.
acw.tk.call("::tk::unsupported::MacWindowStyle", "style", acw._w, acw.tk.call("::tk::unsupported::MacWindowStyle", "style", acw._w,
"help", "noActivates") "help", "noActivates")
except TclError: except TclError:
@ -271,6 +266,7 @@ class AutoCompleteWindow:
# place acw above current line # place acw above current line
new_y -= acw_height new_y -= acw_height
acw.wm_geometry("+%d+%d" % (new_x, new_y)) acw.wm_geometry("+%d+%d" % (new_x, new_y))
acw.deiconify()
acw.update_idletasks() acw.update_idletasks()
except TclError: except TclError:
pass pass

View file

@ -0,0 +1 @@
Fix completions for Tk Aqua 8.7 (currently blank).