X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b9a4190f70909de9568f45389e7aa3ecbc66b8a..7a0a63aeee7a95b65bf133c8fa7a47538710f12c:/wxPython/demo/viewer.py diff --git a/wxPython/demo/viewer.py b/wxPython/demo/viewer.py index befb03ece6..61d6eeefc8 100644 --- a/wxPython/demo/viewer.py +++ b/wxPython/demo/viewer.py @@ -1,4 +1,10 @@ #!/usr/bin/env python +# +# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# + """ Run wxPython in a second thread. @@ -56,7 +62,8 @@ class viewer_thread: def start(self): """ start the GUI thread """ - import thread,time + import time + import thread thread.start_new_thread(self.run, ()) def run(self): @@ -68,9 +75,10 @@ class viewer_thread: 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 @@ -80,7 +88,8 @@ class viewer_thread: 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)