I have made a Toplevel widget but when it pops up it always appears below my root window. Is there an easy way I can make it come to the top most level when it pops up?
Asked
Active
Viewed 2,646 times
2
-
`Toplevel.lift` is probably what you want, just pass the root window as argument and the toplevel will be lifted above the root. – Tadhg McDonald-Jensen Mar 16 '16 at 22:15
2 Answers
4
you can use the .lift()
method on a Toplevel widget:
import tkinter
root = tkinter.Tk()
root.title("root")
top = tkinter.Toplevel(root)
top.title("top")
top.lift(root)
root.mainloop()
according to this documentation you should be able to just use top.lift()
to raise above all other windows but it didn't seem to work for me.
Edit: calling top.lift()
without arguments does work when called during the mainloop, although since this question was specifically when starting the program that isn't very useful.

Tadhg McDonald-Jensen
- 20,699
- 5
- 35
- 59
1
try attributes
import tkinter
root = tkinter.Tk()
root.title("root")
top = tkinter.Toplevel(root)
top.attributes('-topmost', 'true')
top.title("top")
root.mainloop()

andsa
- 221
- 2
- 5