I am trying to make my messagebox appear in front of my pygame window, but it keeps appearing behind it. Here's my code:
from tkinter import messagebox
# pygame loop here
messagebox.showinfo("Title", "Message here")
Do I need to do add some lines of code to bring it to the front? Any help would be appreciated.
I got it to work. I had to add root.withdraw() as well.
import tkinter as tk
from tkinter import messagebox
root = tk.Tk()
root.withdraw()
# pygame loop here
messagebox.showinfo("Title", "Message here")
root.lift()
Not sure why hiding the root tkinter window makes it work...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With