Tkinter, how to get a button's bg color

John McMonagle jmcmonagle at velseis.com.au
Tue Apr 3 21:29:57 EDT 2007


upftftip at gmail.com wrote:
> 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')





More information about the Python-list mailing list