[pygtk] Tow instance of the same pyGTK application in a the same process

Thomas Güttler hv at tbz-pariv.de
Thu Jan 25 17:42:19 WST 2007


Am Donnerstag, 25. Januar 2007 02:00 schrieb Mystilleef:
> Multiple instances of your application can share the same mainloop. All
> you need to do is design an "InstanceManager" class that creates new
> instances of your application. "InstanceManager" runs on the mainloop.
> "InstanceManager" should have functions to create and keep track of all
> instances of your application, perhaps stored in a list. When there are
> no more instances of your application in the list, just quit the
> mainloop. There is no threading needed. Of course each instance of
> your application will have a reference to "InstanceManager" and the
> methods (e.g. new_window, get_instances, focus_window, etc) it exposes.
> Thus, "InstanceManager" becomes a mediator, and you can use it to
> communicate with other instances, through the methods it exposes. I've
> used this pattern successfully in one of projects.

Hi!

Sounds interesting. But I don't understand it.
How do the instances (processes) communicate? How does the
event get passed to the child process?

 Thomas


-- 
Thomas Güttler, http://www.tbz-pariv.de/ 
Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917


More information about the pygtk mailing list