Tkinter:是否可以更改放置的 Frame 的堆叠顺序?

Edu*_*rdo 5 python tkinter

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

有没有办法改变堆叠顺序?

gil*_*gil 6

您可能正在寻找:

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
Run Code Online (Sandbox Code Playgroud)

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