Tkinter 窗口分层 [英] Tkinter window layering

查看:58
本文介绍了Tkinter 窗口分层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 Tkinter 窗口,如何让一个窗口始终位于另一个窗口之上?

I have two Tkinter windows, How do I keep one window always on top of the other?

推荐答案

AFAIK 无能为力.根据官方tk文档

There isn't anything you can do AFAIK. According to the official tk documentation,

...没有可靠的跟踪方法更改窗口中的位置堆叠顺序.

...there is no reliable way to track changes to a window's position in the stacking order.

您能做的最好的事情就是定期将一个窗口升高到另一个之上.我不建议这样做,因为它可能会产生一些非常灾难性的副作用(例如,使用户很难或不可能移动始终低于最顶部的窗口)

About the best you could do is to periodically raise one window above the other. I don't recommend that because it may have some really disastrous side effects (for example, making it difficult or impossible for the user to move the window that is always lower than the top-most one)

这篇关于Tkinter 窗口分层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆