TKinter window is blank/grey on macOS.
I have the default version of Tkinter (8.5), Python 3.10.11 through pyenv installed with macOS Ventura 13.3.1 on a Macbook Pro M2 (2023)
When I try tkinter._test(), the window below appears.
I have observed a strange behavior that whenever I place a button in the window, the window background is black and the button appears (yet no labels do, regardless of color settings).
When I place labels only, the window is just grey.
Example:
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="Hello World!", fg="red")
label.pack()
root.mainloop()
results in
Yet,
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="Hello World!", fg="red")
label.pack()
button = tk.Button(root, text="Click Me", fg="blue")
button.pack()
root.mainloop()
results in this
I have tried upgrading to Tkinter 8.6 through homebrew using the instructions in various posts, however, this didn't work - python is always using 8.5. But since this issue is so particular, I suspect that it might be independent of the version anyway.
Would appreciate any help!