how to show GUI and move on

Currently I have an app which is started in a thread, and it reads a directory for new files…when it finds them it does stuff with them. Anyhow, now i have added a GUI…

so when my app is started I do something like…

class MyApp:
def init(self):
self.setupTheApplication()
self.setupGUI()

def setupGUI():
    self.app = MyGUIApp(0)
    self.MainLoop()

class MyGUIApp(
wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
appFrame = MyFrame(None, -1, “”)
self.SetTopWindow(appFrame)
appFrame.Show()
return 1

…however the MainLoop call blocks the rest of the app from continuing…how can I show the GUI and still handle other stuff going on?

thanks.

I think you have an error. Instead of writting “self.MainLoop()”, try “self.app.MainLoop()”.

Another thing you can try is to instanciate MyGUIApp outside any class, and call it’s MainLoop method. Like this:

class MyGUIApp( wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
appFrame = MyFrame(None, -1, “”)
self.SetTopWindow(appFrame)
appFrame.Show()
return 1

App = MyGUIApp()

App.MainLoop()

···

----- Original Message -----

From:
Craig W

To: wxPython-users@lists.wxwidgets.org

Sent: Tuesday, January 24, 2006 11:40 AM

Subject: [wxPython-users] how to show GUI and move on

Currently I have an app which is started in a thread, and it reads a directory for new files…when it finds them it does stuff with them. Anyhow, now i have added a GUI…

so when my app is started I do something like…

class MyApp:
def init(self):
self.setupTheApplication()
self.setupGUI()

  def setupGUI():
      self.app = MyGUIApp(0)
      self.MainLoop()

class MyGUIApp( wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
appFrame = MyFrame(None, -1, “”)
self.SetTopWindow(appFrame)
appFrame.Show()
return 1

…however the MainLoop call blocks the rest of the app from continuing…how can I show the GUI and still handle other stuff going on?

thanks.