Reputation: 41
As the title suggests, is it possible to check whether a tkinter window is withdrawn or not?
I am aware of the fact, that I can have a variable toggled True/False whenever I withdraw/deiconify a window, but in my case, that will simply be too messy.
Upvotes: 4
Views: 1280
Reputation: 385910
You can call the method winfo_viewable
which returns whether or not the widget is visible.
From the official tcl/tk documentation:
Returns 1 if window and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped.
Upvotes: 6