X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..06b781c7c630ff8c2ab30211cb4351b4cb5bfb47:/wxPython/demo/viewer_basics.py diff --git a/wxPython/demo/viewer_basics.py b/wxPython/demo/viewer_basics.py index fe71140ec3..1dca97130d 100644 --- a/wxPython/demo/viewer_basics.py +++ b/wxPython/demo/viewer_basics.py @@ -20,42 +20,50 @@ class VtkFrame(wxFrame): coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) ren.AddActor(coneActor) + #--------------------------------------------------------------------------- wxEVT_ADD_CONE = 25015 def EVT_ADD_CONE(win, func): win.Connect(-1, -1, wxEVT_ADD_CONE, func) + class AddCone(wxPyEvent): def __init__(self): wxPyEvent.__init__(self) self.SetEventType(wxEVT_ADD_CONE) + class HiddenCatcher(wxFrame): """ The "catcher" frame in the second thread. It is invisible. It's only job is to receive - Events from the main thread, and create + Events from the main thread, and create the appropriate windows. - """ + """ def __init__(self): - wxFrame.__init__(self, NULL,-1,'') + wxFrame.__init__(self, None, -1, '') EVT_ADD_CONE(self, self.AddCone) - def AddCone(self,evt): + def AddCone(self,evt): add_cone() + + #--------------------------------------------------------------------------- + class SecondThreadApp(wxApp): """ wxApp that lives in the second thread. - """ + """ def OnInit(self): catcher = HiddenCatcher() #self.SetTopWindow(catcher) self.catcher =catcher return true + #--------------------------------------------------------------------------- -def add_cone(): - frame = VtkFrame(NULL, -1, "Cone") +def add_cone(): + frame = VtkFrame(None, -1, "Cone") frame.Show(true) +