Python Tkinter:是否可以更改已放置框架的堆叠顺序?

Python Tkinter:是否可以更改已放置框架的堆叠顺序?,python,tkinter,Python,Tkinter,我一直在尝试在根窗口中放置框架。据我所见,堆叠顺序是在创建帧时确定的 先创建的低于后创建的。地点的顺序 似乎没有任何效果 是否有办法更改堆叠顺序?您可能正在寻找: 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 stac

我一直在尝试在根窗口中放置框架。据我所见,堆叠顺序是在创建帧时确定的 先创建的低于后创建的。地点的顺序 似乎没有任何效果


是否有办法更改堆叠顺序?

您可能正在寻找:

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

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

注意tkinter中有一个bug,它阻止
lift
使用画布小部件。要绕过该错误,请参见。