Hi all,
I am trying to update the colour of a Tkinter label, so as the value of a variable changes so to does the colour of the text.
Below is a simple example of what I am trying to achieve, but the problem is when I press the button I want the labels colour to update to red.
from Tkinter import *
root = Tk()
colour = StringVar()
colour.set('blue')
def colourUpdate():
colour.set('red')
root.update()
btn = Button(root, text = "Click Me", command = colourUpdate)
l = Label(root, textvariable=colour, fg = colour.get())
l.pack()
btn.pack()
root.mainloop()