I'm having an issue with the grab_set command when opening a toplevel window on my Pi. I'm using a grab_set to disable the screen below the toplevel and releasing it on close of the window.

I doesn't happen every time but on occasion I will get this error: _tkinter.TclError: grab failed: window not viewable

The window will appear but the grab didn't work. Is there a way to fix this?

1 Answer 1


Use wait_visibility() before grab_set().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.