🔍 See Original Answer on Stack Overflow 🔗
How to make a Tkinter window jump to the front?
August 4, 2020
November 24, 2022
Copy to clipboard: false
This answer is to make one Tkinter Window pop up overtop of other Tkinter windows.
In my app I have a large window
toplevel which calls a much smaller window
top2 which initially appears on top of
If user clicks within
toplevel window it gains focus and smothers much smaller
top2 window until
toplevel window is dragged off of it.
The solution is to click the button in
toplevel to launch
top2 again. The
top2 open function knows it is already running so simply lifts it to the top and gives it focus:
def play_items(self): ''' Play 1 or more songs in listbox.selection(). Define buttons: Close, Pause, Prev, Next, Commercial and Intermission ''' if self.top2_is_active is True: self.top2.focus_force() # Get focus self.top2.lift() # Raise in stacking order root.update() return # Don't want to start playing again