[Python] overrideredirect() no longer working on MAC?

Discussão em 'Python' iniciado por Stack, Janeiro 16, 2025.

  1. Stack

    Stack Membro Participativo

    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()


    EDIT: I tried calling the method from the quit_button but got an error that button has no such attribute

    quit_button.overrideredirect(True)

    Continue reading...

Compartilhe esta Página