Hi, the app I'm working on is let's say a rich text editor ( http://giuspen.com/cherrytree)
so far I've allowed a single instance only for simplicity but now I would like to introduce the opportunity to open more instances of different documents, but avoid to open twice the same document for mistake and instead put the running window to toplevel in case there's already an instance of that document opened. it seems to me that the only way to obtain this is to have a server that controls all the instances, being my app cross platform I opted for a tcp/ip server in loopback 127.0.0.1. the problem is that when the server opens a new thread, as soon as the new thread enters the gtk main loop (gtk.main()) the server stucks. I thought that a new thread, opened with thread.start_new_thread(..) was not blocking but instead the main loop blocks all. 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. Best regards, Giuseppe.
_______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/