tags:

views:

12

answers:

1

How can I dynamically change the background color of a button in Tkinter ?

It only works when I initialize the button:

self.colorB = tk.Button(self.itemFrame, text="", bg="#234", width=10, command=self.pickColor)

I've tried this:

   self.colorB.bg = "#234"

but it doesn't work.. thanks

+2  A: 

Use the configure method

self.colorB.configure(bg = "#234")
volting