Reputation: 831
I'm creating a simple UI, my problem is that buttons are always white also if I change all their color properties...I'm new in Tkinter maybe I'm missing something.
This is the code, you can just copy and run:
import tkinter
tk = tkinter.Tk()
def browseFiles():
print("Browsing...")
browseButton = tkinter.Button(
tk, text="Browse files", command=browseFiles, fg='#03045e', bg='#caf0f8', background='#ef233c', activeforeground='blue').pack()
tk.mainloop()
MacOS version : 11.5.2
withPython 3.10.0rc2
, tcl-tk 8.6.11_1
and when I run the code this is the warning :
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Maybe I should downgrade to a python stable version ?
Upvotes: 2
Views: 606
Reputation: 831
Solved :
pip3 install tkmacosx
This will install some extensions that will fix the problem.
Just one thing be sure to switch interpreter, maybe you're not using the right one.
In my case it worked when I used this one .
Check where
tkmacosx
has been installed, you should use the same interpreter version I guess.
Upvotes: 4