Pygtk, libglade

Fredrik Arnerup e97_far at e.kth.se
Wed Dec 10 01:52:24 CET 2003


Vams <gte181u at prism.gatech.edu> writes:

>
> Problem:
> ---------- gtk.main() -------------
> The GUI won't show up w/o calling this function.  And if I do call
> this function, the control of my program will stay in the mainloop
> until it exists (GUI closes).  This stops the daemon from doing what
> it normally does.
>
> So, what do I need to do?  Should I have the gtk.main() in its own
> thread or something?  Or can I somehow extend the gtk.main() so that
> it does my program's tasks while keeping an eye on the GUI?

I don't know if running mainloop in separate thread is a good idea. I
suggest running your main program in a separate thread.
(See the faq on threading:
http://www.async.com.br/faq/pygtk/index.py?req=index)

An alternative is to use gtk.timeout_add() to call the main program at
regular intervals.

-- 
Fredrik Arnerup <e97_far at e.kth.se>




More information about the Python-list mailing list