Skip to main content
 首页 » 编程设计

python之Tkinter:是否可以更改放置的框架的堆叠顺序

2024年10月24日12zhujiabin

我一直在尝试将 Frames 放置在根窗口中。据我所知,堆叠顺序是在创建框架时确定的, 先创建的在后创建的之下。 .place 的顺序 似乎没有任何影响。

有什么方法可以改变堆叠顺序吗?

请您参考如下方法:

您可能正在寻找:

widget.lift()          # move to the top of the stack 
widget.lift(another)   # move to just above another widget 
widget.lower()         # move to the bottom of the stack 
widget.lower(another)  # move to just below another widget 

解释 here . (这是我能找到的最好的文档。如果你阅读 effbot,它看起来像 lift 和 lower 只适用于 windows,但实际上它们也适用于其他小部件。)