Tkinter main window 在消息框后变得无响应

Tkinter main window becomes unresponsive after message box

我对 Tkinter 有疑问。在消息框之后,我无法在主 window 中编辑条目。下面简单地用这个问题来编码。你能帮帮我吗?

from tkinter import messagebox, Entry, Tk


def pop_error():
    messagebox.showerror(message="Error")


win = Tk()
entry = Entry(win)
entry.grid()
pop_error()
win.mainloop()

关闭messagebox

后强制Entry对焦
from tkinter import messagebox, Entry, Tk

def pop_error():
    messagebox.showerror(message="Error")

win = Tk()
entry = Entry(win)
entry.grid()
pop_error()
entry.focus_force()
win.mainloop()