Skip to content
Closed
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
16 changes: 15 additions & 1 deletion Lib/idlelib/autocomplete_w.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
WINCONFIG_SEQUENCE = "<Configure>"
DOUBLECLICK_SEQUENCE = "<B1-Double-ButtonRelease>"

_TK_FULL_VERSION = None

class AutoCompleteWindow:

def __init__(self, widget, tags):
Expand Down Expand Up @@ -61,6 +63,14 @@ def __init__(self, widget, tags):
# Flag set to avoid recursive <Configure> callback invocations.
self.is_configuring = False

@property
def _tk_full_version(self):
global _TK_FULL_VERSION
if _TK_FULL_VERSION is None:
version_str = self.widget.tk.call("info", "patchlevel")
_TK_FULL_VERSION = tuple(map(int, version_str.split(".")))
return _TK_FULL_VERSION

def _change_start(self, newstart):
min_len = min(len(self.start), len(newstart))
i = 0
Expand Down Expand Up @@ -206,7 +216,11 @@ def show_window(self, comp_lists, index, complete, mode, userWantsWin):
scrollbar.config(command=listbox.yview)
scrollbar.pack(side=RIGHT, fill=Y)
listbox.pack(side=LEFT, fill=BOTH, expand=True)
acw.update_idletasks() # Need for tk8.6.8 on macOS: #40128.
if (
platform.system() == "Darwin" and
(8, 6, 8) <= self._tk_full_version < (8, 6, 10)
):
acw.update_idletasks() # Need for tk8.6.8 on macOS: #40128.
acw.lift() # work around bug in Tk 8.5.18+ (issue #24570)

# Initialize the listbox selection
Expand Down