Louie Lu added the comment:

The reason why click on listbox will disappear is because we bind 
HIDE_VIRTUAL_EVENT with <focusOut> on widget.text. When click on listbox, it 
will focusOut the widget.text then focusOn listbox, thus trigger the hide 
process.

The reason why click on listbox and move the cursor out of box, then click will 
freeze IDLE cursor, it because tk will generate three event:  FocusOut, 
FocusOut, and ButtonPress:


hidell <FocusOut event> generated by:  
.!listedtoplevel.!frame.text.!toplevel2.!listbox focus on:  None
hidell <FocusOut event> generated by:  .!listedtoplevel.!frame.text.!toplevel2 
focus on:  None
prove <ButtonPress event num=1 x=130 y=390> generated by:  
.!listedtoplevel.!frame.text focus on:  .!listedtoplevel.!frame.text

Becase we bind HIDE process on widget.text, it will then trigger hide_window, 
and at the same time, FoucsOut event is still on the half-way, and then the 
listbox is destory and reset to None, I think this is why it will freeze until 
re-focus on IDEL.


Attach PR solve this problem, it re-bind the HIDE process from widget.text to 
listbox, thus it will not trigger some race-contidion when destroying 
autocompletewindow.

----------
nosy: +louielu

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15786>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to