Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if tkinter window is withdrawn?

Tags:

python

tkinter

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.

like image 524
sebastian Avatar asked Sep 21 '25 03:09

sebastian


1 Answers

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.

like image 73
Bryan Oakley Avatar answered Sep 22 '25 18:09

Bryan Oakley