0

I've just started learning tkinter, and I can't seem to get the background colour attribute of a button to work - I'm not sure why, as the foreground colour is working.

I tried instantiating a button object with a text label, a simple command (that has worked previously) and foreground and background colours, as so:

button1 = Button(root, text="click me!", command = myClick, fg="red", bg="yellow")

Then proceeded to pack the button, do the main loop, etc. Everything except the background colour is working, and I've tried this in IDLE and Mu. The button appears, the text is red, the command works, but the background is white.

(side question, I've been told my question has 'not been received well by the community', any idea why? I made sure to follow all the guidelines)

jsbueno
  • 99,910
  • 10
  • 151
  • 209
Cmdr. Data
  • 11
  • 3

1 Answers1

1
from tkmacosx import Button

# ...
button1 = Button(root, text="click me!", command = myClick, fg="red", bg="yellow")
button1.pack()

# ...
user16217248
  • 3,119
  • 19
  • 19
  • 37
toyota Supra
  • 3,181
  • 4
  • 15
  • 19