Hello everyone,
I need some help in making a gtk.Button insensitive when a gtk.Entry
contents have changed. I have tried many different signals, each of them
failed to do what i wanted.
I'm confused -- have you tried simply using the 'changed' signal on the Entry?
Here's some quick code that seems to do what you want:
import gtk
e = gtk.Entry()
b = gtk.Button('Test Button')
b.set_sensitive (False)
def entry_changed_cb (entry):
text = entry.get_text()
if text: b.set_sensitive(True)
else: b.set_sensitive(False)
e.connect('changed',entry_changed_cb)
w = gtk.Window()
vb = gtk.VBox()
vb.add(e); vb.add(b)
w.add(vb)
w.show_all()
w.connect('delete-event',gtk.main_quit)
gtk.main()
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
