python - 检查tkinter窗口是否被撤回?

标签 python tkinter

正如标题所示,是否可以检查 tkinter 窗口是否已撤回?

我知道这样一个事实,每当我撤回/取消图标化窗口时,我都可以切换 True/False 变量,但就我而言,这太困惑了。

最佳答案

您可以调用方法winfo_viewable,该方法返回小部件是否可见。

来自官方 tcl/tk 文档:

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.

关于python - 检查tkinter窗口是否被撤回?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49989727/

相关文章:

Python/Tkinter : How to reduce the size of the expanded frames to their first positions?

python - sklearn : get score of prediction from random forest?

Python HTTP请求替换bash的curl

python - 如何在 Tkinter/TTK 中稍微移动标签中的文本?

python - 如何在 tkinter 的主窗口前面放置一个顶层窗口?

python - 方法后 Tkinter 的内部工作

python - NumPy,PIL 添加图像

python - 如何使用 opencv 从图像中删除黑色背景并使其透明?

python - 从文档术语矩阵计算前 n 个单词对共现

Python Tkinter - 选项数据库仅部分工作