Terry J. Reedy <tjre...@udel.edu> added the comment:

You only need to run .update_idletasks(), as there are no pending events to 
process.

This is not a tkinter issue.  It is a known fact that there are undocumented 
annoying differences in tk behavior on different systems and even different 
versions thereof.  In #34275, for instance, we had to add .update_idletasks for 
IDLE calltips to appear on Macs with recent tk versions.

For Windows, your code also needs entry.focus_set to be able to enter text, 
after the mbox is dismissed, without activating the widget with a click.

Indeed, the call is needed here on Mac with Python 3.7.0 and tk 8.6.8.  Without 
it, the root window partially keeps the focus, in that the traffic lights 
remain light, and the messagebox only partially get the focus, in that the 
title and OK button are dimmed.  One has to click on the box to highlight the 
title and OK.  With the call, the root lights go out and the box is active, and 
can be dismissed with <Enter>.

There is an additional issue on current Mac.  When the mbox is dismissed, focus 
does not return properly to the root and entry.  They have to be clicked on.  
Since this is similar to the problem in #34120, and since Novel's issue on 
Windows is exactly like the 'have to go away and come back' part of #34120, I 
wonder if the model mbox needs an explicit grab release.

Kevin, since the mbox is created and destroyed within a call to the tk 
messageBox function we have no control of its operation.  Perhaps you could 
check the tcl/tk code and see it if needs updating, as did the IDLE code.

----------
nosy: +serhiy.storchaka, terry.reedy, wordtech
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> behavior

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

Reply via email to