tkinter get widget option value

Rob Williscroft rtw at freenet.co.uk
Tue May 8 16:15:14 EDT 2007


 wrote in news:1178649638.119603.265380 at y5g2000hsa.googlegroups.com in 
comp.lang.python:

> 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'
> 

print w.cget( "state" )

Rob.
-- 
http://www.victim-prime.dsl.pipex.com/



More information about the Python-list mailing list