tkinter get widget option value

rahulnag22 at yahoo.com rahulnag22 at yahoo.com
Tue May 8 17:29:17 EDT 2007


On May 8, 2:15 pm, Rob Williscroft <r... at freenet.co.uk> wrote:
>  wrote innews:1178649638.119603.265380 at y5g2000hsa.googlegroups.comin
> 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/

Thanks Rob, that does it.




More information about the Python-list mailing list