Björn
Björn

Reputation: 1822

How to get the Default values of a Tkinter Label

I am trying to set the Background Color of Label (which I before changed) back to its default value. How do I get the default values?

My first approach was, after I saw in the Tkinter docs that if u call .configure without passing any arguments, that u get back a dictionary of the contents, was this

print label1.configure()[bg]

This didnt work for me.

Sorry I am really new and I know its kind of basic question but my web searches just brought me to "How do I change the Background color" etc.

Best regards a beginner in needs

Upvotes: 0

Views: 274

Answers (1)

nosklo
nosklo

Reputation: 222842

Try using the cget method.

print label1.cget('bg')

Upvotes: 1

Related Questions