python - overrideredirect() no longer working on MAC? - Stack Overflow

时间: 2025-01-06 admin 业界

I have a python script that hides the title bar using overrideredirect(True).

Suddenly the title bar is no longer affected by the overrideredirect() call.

I am not aware of anything in my system that changed, which could have changed this behavior, but SOMETHING changed obviously. What might have caused this?

This is python 3.12 on Mac Ventura

#! /usr/local/bin/python3.12
from tkinter import *

root = Tk()
quit_button = Button(root, text="Q")
quit_button.pack(side=LEFT)
label = Label(root, text="")
label.pack(side=LEFT,pady=0)
root.overrideredirect(True)  #  This used to make title bar disappear
root.attributes('-topmost', True)
root.geometry("200x18")
root.mainloop()
最新文章