tkinter如何使Toplevel保持在主窗口的上面

tkinter怎么使Toplevel保持在主窗口的上面
我是用python的tkinter做的GUI。
在主窗口中创建了一个Toplevel窗口,然后每次我点击主窗口,Toplevel窗口就被主窗口挡在后面了,有什么地方可以设置,使得toplevel窗口永远在主窗口上面吗?
------解决思路----------------------
这儿(http://stackoverflow.com/questions/9135302/using-python-tkinter-always-on-top-window-isnt-showing-custom-class-tooltip-t)提到的代码:


        Popup = Toplevel(root)
        Popup.resizable(0,0)
        Popup.attributes("-toolwindow", 1)
        Popup.wm_attributes("-topmost", 1)


不知道是否符合你的要求。

贴出你的代码,更容易说清楚想要哪个窗口在上面。
------解决思路----------------------
1. 这儿说它们是一样的(http://effbot.org/tkinterbook/wm.htm#wm.Wm.wm_attributes-method):

attributes(*args) [#]
Sets or gets window attributes. In Python 2.4, this wrapper is incomplete, and the application must use a non-standard syntax to modify and query the available attributes.

Same as wm_attributes.

2. toolwindow=
(Windows) If set, sets the window style to a “tool window”. Note that in this release, this attribute must be given as “-toolwindow”.

不知道“tool window”是什么,也许版本间有变化,我这儿没法测试。可以试试用attributes()不带参数,可以得到所有的attributes,看看toolwindow是否在其中。如果你不需要的话,把这句去掉也可以。