[pygtk] gtk.set_state question. Change button state

Timo timovwb at gmail.com
Mon Jun 16 15:08:08 WST 2008


Hey, try widget.set_sensitive(0) to disable a widget and
widget.set_sensitive(1) to enable a widget.

Timo


rudsonalves op yahoo.com.br schreef:
> Hi group,
>
> I desable a button with button.set_state(gtk.STATE_INSENSITIVE) in one
> procedure. In other I need enable it, but a simple
> button.set_state(gtk.STATE_NORMAL), not enable it.
>
> How I can make it?
>
> Program sample:
> def b1_callback(widget, data = None):
>     print 'button1 is clicked. Disable button 1.'
>     widget.set_state(gtk.STATE_INSENSITIVE)
>
> def b2_callback(widget, button):
>     print 'button 2 is clicked. Enable button 1.'
>     button.set_state(gtk.STATE_NORMAL)
>
> class test:
> ...
>     button1 = gtk.Button('Button 1')
>     button2 = gtk.Button('Button 2')
>     button1.connect('clicked', b1_callback)
>     button2.connect('clicked', b2_callback)
> ...
>
> Thanks,
> Rudson Alves
>
>
>
>
> _______________________________________________
> pygtk mailing list   pygtk op daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>   



More information about the pygtk mailing list