tkinter get widget option value

James Stroud jstroud at mbi.ucla.edu
Tue May 8 20:51:47 EDT 2007


rahulnag22 at yahoo.com wrote:
> Hi,
> If I have a button widget
> 
> w = Button(root, text = "Button", state = 'disabled')
> 
> How can I get the value of option 'state' from the widget 'w'.
> I want something like --
> 
> print w.state  >> to print out >> 'disabled'
> 
> Thanks
> Rahul
> 

print w["state"]

James



More information about the Python-list mailing list