[pygtk] launch modules after gtk.main is executed

Matthias Bläsing matthias.blaesing at rwth-aachen.de
Sat Feb 18 17:11:57 WST 2006


Am Freitag, den 17.02.2006, 19:32 -0600 schrieb Angel Arturo Pérez Mtz:

> I want to launch a module automatically after gtk.main() is been
> executed. But I don't want to wait for an event generated an click.
> 
> How can I get this?

Pretty easy:

import gobject
gobject.idle_add(<function you want to have called>)

Now <function you want to have called> will be called, when ever the
mainloop is idle (that is pretty often!). So you have to tell it, that
you wan't it to be called only once - to do that, return FALSE from
<function you want to have called>, else return TRUE.

HTH

Matthias

-- 
Matthias Bläsing (GPG-Schlüsselkennung: A71B4BD5)
ICQ: 84617206   AIM: linuxfun81   MSN: linuxfun at hotmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060218/e3603b1f/attachment.pgp


More information about the pygtk mailing list