Fwd: Re: [pygtk] button queue

Mr Jason Cupp forrestcupp at yahoo.com
Tue Aug 1 08:31:19 WST 2006


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?

"David M. Cook" <dave at davidcook.org> wrote: Date: Mon, 31 Jul 2006 09:21:32 -0700
From: "David M. Cook" <dave at davidcook.org>
To: pygtk at daa.com.au
Subject: Re: [pygtk] button queue

 On Mon, Jul 31, 2006 at 07:11:56AM -0700, Mr Jason Cupp wrote:

> I am pretty new to pygtk.  I wrote a program where there are several
buttons that are connected to a method that plays different wav files using
pymedia.  My problem is that if I keep pressing buttons while a wav is being
played, it queues the events and just keeps playing audio files for the
events that were racked up.  I want a button to only work when an audio file
is not being played.
===

You should make the button insensitive in your "click" callback, and then
make it sensitive again when the program is ready.  If the button action is
also a menu item, you can use the action API.  See sections 16.1 and 16.7 of
the tutorial.

Dave Cook


_______________________________________________
pygtk mailing list   pygtk at daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


 		
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060731/9942dc11/attachment-0001.htm


More information about the pygtk mailing list