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

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


I know this is an old question but I found it weird that no one came up with the simple solution I had,

app = SampleApp()app.attributes('-topmost', True)app.update()app.attributes('-topmost', False)app.mainloop()


I got into same issue today. OSX LION 10.7.2. Add this code before mainloop() solves the issue.

root.call('wm', 'attributes', '.', '-topmost', '1')

but the window always remains on top of the others until you close it. For real solve, we need to make it an app bundle, with py2app.


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()