Hi,
once more a question about threading and the mainloop. Do I remember right, that the the mainloop has to run in the main thread, i.e. that one which is started with the python interpreter or is the only necessity that no gui functions may be called from outside the mainloop thread?
I am asking because I would like to use wxpython in a COM server. Currently I am instantiating a new wx.App object every time I need to show a dialog, etc. but doing so, the COM server is blocked while the wxpyhton mainloop is running.
The following example (as suspected) does not work.
import wx
from threading import Thread
class Main(Thread):
def __init__(self):
Thread.__init__(self)
self.app = wx.PySimpleApp(0)
f = wx.Frame(None)
f.Show()
def run(self):
self.app.MainLoop()
t = Main()
t.start()
raw_input()
Any pointers are highly appreciated. I really want to avoid to code the gui using the pywin32 extensions.
Regards, Christian