X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b9a4190f70909de9568f45389e7aa3ecbc66b8a..db679b8c836e69c111cdc31e62cf92cebe4f938f:/wxPython/demo/viewer.py?ds=inline diff --git a/wxPython/demo/viewer.py b/wxPython/demo/viewer.py index befb03ece6..a0332d98cb 100644 --- a/wxPython/demo/viewer.py +++ b/wxPython/demo/viewer.py @@ -1,4 +1,5 @@ #!/usr/bin/env python + """ Run wxPython in a second thread. @@ -56,7 +57,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 +70,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 +83,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)