0
from tkinter import *

root = Tk()

def myClick():
    myLabel = Label(root, text='Button clicked. ')
    myLabel.pack()

myButton = Button(root, text="Click me!", command=myClick, fg='blue', background="red", activeforeground='green', activebackground='black')


myButton.pack()
root.mainloop()

The code runs fine except the background color. Could someone help? Many thanks BTW, I'm using Python 3.7.4 and macOS Catalina 10.15.2

stovfl
  • 14,998
  • 7
  • 24
  • 51

1 Answers1

0

On python 3.8 and windows 7 at least is work fine. Style can work to, but with what u set is text color blue and background red, when the button is pressed the text will become green and the background black.

ASI
  • 334
  • 3
  • 15