Il giorno mer, 30/03/2011 alle 13.50 +0200, Giuseppe Penone ha scritto: > I found some tips on threading on pygtk > (http://faq.pygtk.org/index.py?file=faq20.006.htp&req=show) so I tried > gtk.threads_enter() > > gtk.main() > gtk.threads_leave() > that works on the first opened instance but then crashes on the > second. > > If anybody has a clue about treating many instances of the same app > being aware of an already running instance/able to > control the already running instance rather than spawning a new one > please help me. >
(Assuming that indeed there's no way of using sockets in a non-blocking fashion - I'm totally ignorant about that) maybe having a little process created with multiprocessing would be simpler & more portable, for you, than using threading? I guess a single one is sufficient, so the overhead shouldn't be significant, even on Windows. Then, at every iteration of the main loop, the main process could check, from a shared Value (or Array), if there's something to open. (untested, sorry if I wrote something stupid) Pietro _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
