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?
You can ask the button what color it is before you change it. Save the color, and then restore it later:
orig_color = the_button.cget("background")
the_button.configure(background="red")
...
the_button.configure(background=orig_color)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With