Tkinter, how to get a button's bg color
James Stroud
jstroud at mbi.ucla.edu
Wed Apr 4 04:13:20 EDT 2007
John McMonagle wrote:
> 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')
>
>
Even more fun is b['bg']
James
More information about the Python-list
mailing list