why I can't change background color of a tkinter button using python on a Mac?

Viewed 275

I have a simple python code on my Mac, tryin to change background color of a button, in a tkinter window:

from tkinter import *
w=Tk()
def change():
    b.config(bg='yellow')
b=Button(w,text='CHANGE',command=change)
b.pack()
w.mainloop()
1 Answers

Tkinter uses tk, and tk uses native toolkits, and on OSX the native toolkits don't allow you to change the background color of buttons.

Related