How to reset background color of a python tkinter button?

Viewed 16660

Simple question, have parsed numerous search results, haven't found a simple answer. I set a very urgent button to red if something is not found so users click it first. Once clicked, I want to set the background back to normal like button.config(bg=''). I tried 'grey' but it's not the right color.

What do I set it to?

4 Answers

I use the code:

def ToGray(self, to_gray):
    to_gray['bg'], to_gray['fg'] = "SystemButtonFace", "Black"

Then you can get the default button or label.

The default background color of tkinter is #f0f0f0. Hope this helps ;)

Related