At 5:31 PM -0700 7/31/06, Mr Jason Cupp wrote: >I don't know if I'm doing this mailing list right, but anyway: >I tried making a method that either makes a button insensitive or >sensitive according to the data that I pass it using >self.button.set_sensitive(True) or self.button.set_sensitive(False). This >is what was suggested. For some reason it didn't work. The program is >supposed to make the buttons insensitive, then play the audio file using >pymedia, and time.sleep() until audio is finished playing, then it makes >the buttons sensitive again. But it never makes it insensitive during >this time. So I connected 2 other buttons one that makes sensitive, and >another that makes insensitive, just to see whether the method works or >not. It does work when I click the buttons, but it does not work when the >program automatically tries to turn them off, play audio, then turn them >back on. So the method in itself works. Also in the method I put a >print 'sensitive' and print 'insensitive' to see if the program is >calling the method when it is supposed to, and it is. Any more >suggestions on why this would happen?
Yes. In order to make GTK seem faster, all the work was moved to idle time. You will need to idle a bit before starting the sound. What I do is: def gtkeat(): while gtk.events_pending(): gtk.main_iteration(False) Call gtkeat() after changing the sensitivity, and before starting the sound. ____________________________________________________________________ TonyN.:' <mailto:[EMAIL PROTECTED]> ' <http://www.georgeanelson.com/> _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/