python中tkinter的窗口问题

为什么我的tkinter窗口不会弹出,而且直接最小化到托盘?
以下是我的部分函数代码:

# 弹出提示窗口
def window():
    global root
    root = tk.Tk()  # tkinter窗口初始化
    root.title("闹钟")  # 闹钟提醒窗口的标题
    root.geometry("200x100+550+300")  # 闹钟提醒窗口的大小和初始位置
    root.resizable(False, False)  # 闹钟提醒窗口的长和宽不可拉伸,即禁止调节窗口大小
    root.label1 = tk.Label(root, text="当前时间为:" + get_time())  # 显示标签
    root.label1.place(x=40, y=20)  # 显示标签位于提醒窗口的位置
    root.button = tk.Button(root, text="OK", command=ok_func)  # “OK”按钮,command指令,点击后窗口自动销毁
    root.button.place(x=75, y=60, width=50, height=20)  # “OK”按钮的位置
    root.mainloop()  # 让闹钟提醒窗口保留在屏幕中

最后在主函数中调用这个函数。
窗口能出来,但是当运行到这里时,窗口弹出,直接退到图标托盘(最小化),就是win11底部的中间图标,每次都要点击图标才能打开这个窗口,而不是程序运行到这时,窗口直接弹出。