How to put a tkinter window on top of the others?

后端 未结 7 957
北恋
北恋 2020-12-02 23:23

I\'m using Python 2 with Tkinter and PyObjC, and then I\'m using py2app.

The program is working fine, but the window starts a

7条回答
  •  借酒劲吻你
    2020-12-03 00:15

    For OS X 10.8.3, the combination of the answers provided by vdbuilder and user2435139 did the trick for me, i.e.

    self.root.lift()
    self.root.call('wm', 'attributes', '.', '-topmost', True)
    self.root.after_idle(self.root.call, 'wm', 'attributes', '.', '-topmost', False)
    

    called before

    self.root.mainloop()
    

提交回复
热议问题