Michael Gilfix wrote:

>  Hi. I think I've stumbled upon a bug in 0.6.8 or perhaps I'm
>doing stuff correctly. I wish to be able to gray out a button
>and then re-enable it. So to disable it I do:
>
>     button.set_state (GTK.STATE_INSENSITIVE)
>
>  then later to re-enable it, I do:
>
>     button.set_state (GTK.STATE_NORMAL)
>
>  However, once I set the button state to insensitive, I can no longer
>change it to any other state. This is not true for switching between
>other states such as STATE_ACTIVE and STATE_NORMAL.  Has anyone else
>encountered this bug? Or have a work around?
>
>  In addition, do I use the set_state function gray out menu items
>as well?
>
If you want to disable a button (ie. make it insensitive), don't use the 
set_state() call.  Instead, use:
    button.set_sensitive(gtk.FALSE)

and use TRUE to re-enable it.  set_state() is more for use by widget 
implementors.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to