#!/usr/bin/env python
+
"""
Run wxPython in a second thread.
def start(self):
""" start the GUI thread
"""
- import thread,time
+ import time
+ import thread
thread.start_new_thread(self.run, ())
def run(self):
the import would occur in the main thread and
wxPython wouldn't run correctly in the second thread.
"""
- from viewer_basics import *
+ import viewer_basics
+
try:
- self.app = SecondThreadApp(0)
+ self.app = viewer_basics.SecondThreadApp(0)
self.app.MainLoop()
except TypeError:
self.app = None
send an event to the catcher window in the
other thread and tell it to create a cone window.
"""
- import viewer_basics
+ import viewer_basics
+
if self.app:
evt = viewer_basics.AddCone()
viewer_basics.wxPostEvent(self.app.catcher, evt)