Tkinter, how to get a button's bg color

U

upftftip

I am new to Tkinter. Following an example, I executed the following:

window = Tk()
b = Button(window)
b.configure(bg = '#FF00FF')
b.grid(row = 0, column = 0)

how can I later get the value of this button's background color?

Thanks.
 
J

John McMonagle

I am new to Tkinter. Following an example, I executed the following:

window = Tk()
b = Button(window)
b.configure(bg = '#FF00FF')
b.grid(row = 0, column = 0)

how can I later get the value of this button's background color?

Thanks.

b.cget('bg')
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top