[pygtk] gobject.timeout_add()
John Stowers
john.stowers.lists at gmail.com
Thu Jan 21 15:56:08 WST 2010
On Wed, 2010-01-20 at 21:22 -0800, dj wrote:
> I hope this is the right place to ask this...
>
> I have a python program (using Glade to create the gui) that periodically launches ecasound to make audio recordings of various lengths. In order to keep the gui viable, ecasound runs in a separate thread. In order to keep the program from getting ahead of itself and trying to launch ecasound before the current recording process has finished, I use gobject.timeout_add() for the length of the recording (plus a second or two for safety).
>
> Most of the calls to gobject.timeout_add() are in separate functions with different intervals. All but one of them work. The last one only works if gobject.timeout_add(..., ...)/return False is appended to the end of the function that needs it, rather than calling it.
This doesn't sound like a particuarly nice design, but I can't
immediately think of what the problem is. You should post your code so
others can take a look. In general however, you should remember
* Be careful using threads and PyGtk+
* gobject.timeout_add is not guaranteed to be millisecond precise
John
More information about the pygtk
mailing list