Almost there. Clicking on a list item or the scrollbar works to select an item or scroll. Clicking outside the box *before* clicking elsewhere works to dismiss box. Clicking outside the box *after* clicking inside dismisses the box, but also results in the following, printed twice.
Exception in Tkinter callback
Traceback (most recent call last):
File "F:\dev\cpython\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "F:\dev\cpython\lib\tkinter\__init__.py", line 745, in callit
func(*args)
File "F:\dev\cpython\lib\idlelib\autocomplete_w.py", line 257, in _hide_event_check
if not self.autocompletewindow.focus_get():
AttributeError: 'NoneType' object has no attribute 'focus_get'
The immediate fix is to catch AttributeError or, perhaps better, wrap the body of _hide_event_check with "if self.autocompletewindow:". There should be no need to hide the window if it is already gone.
I am puzzled as to why clicking in the box affects later clicks outside the box. |