[Tkinter-discuss] Exception protection to tk calls

Michael Lange klappnase at web.de
Thu Apr 1 05:21:11 EDT 2021


Hi,

On Thu, 1 Apr 2021 07:54:40 +0000
Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:

> Thank you Michael,
>
> >> grab_release() on a widget that has already been destroyed or, in
> >> the/
>
> this is also my understanding, however the places that happens are on
> Dialog code(s) like
>
(...)
>
> My impression is that on slow network connections (using remote X11
> session), sometimes the dialog is displayed before the wait_visibility
> is being executed and if the user closes the window from the window
> manager, it arrives to the focus_set, grab_set or wait_window with a
> window that doesn't exist and then I get the error message.

if this is the case, maybe calling self.withdraw() early in the __init__
method and then calling protocol() before deiconify() might help?
Just a guess, though. At least it sounds a bit like the users manage to
press the "X" button from the window decorations before the protocol()
has been applied.

Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Totally illogical, there was no chance.
		-- Spock, "The Galileo Seven", stardate 2822.3


More information about the Tkinter-discuss mailing list