Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2394 - in trunk: SwigInterface scenes/csafe/python


Chronological Thread 
  • From:
  • To:
  • Subject: [Manta] r2394 - in trunk: SwigInterface scenes/csafe/python
  • Date: Mon, 6 Apr 2009 17:21:55 -0600 (MDT)

Author: dav
Date: Mon Apr  6 17:21:54 2009
New Revision: 2394

Modified:
   trunk/SwigInterface/wxManta.py
   trunk/scenes/csafe/python/csafe_scene.py
Log:

When a scene calls StartEngine, it can pass its frame to the function.
Then, if the Manta engine quits (via quit menu), the scene's frame's
shutDown() function will be called.  This allows the entire app to
come down gracefully if so desired.

M    scenes/csafe/python/csafe_scene.py

- Added 'shutDown()'
- Added some cosmetic white space to make code easier to read.

M    SwigInterface/wxManta.py

- Added scene shutDown() call.



Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py      (original)
+++ trunk/SwigInterface/wxManta.py      Mon Apr  6 17:21:54 2009
@@ -520,12 +520,20 @@
     
###########################################################################
     def OnCloseWindow(self, event):
         self.ShutdownEngine()
+
+        if self.scene_frame != None :
+            func = getattr( self.scene_frame, "shutDown", None )
+            if func:
+                self.scene_frame.shutDown()
         self.Destroy()
 
     
###########################################################################
     ## StartEngine
+    ##   If a "sceneFrame" is passed in, then sceneFrame.shutDown() will be 
called
+    ## in the event that "quit" is requested.
     
###########################################################################
-    def StartEngine(self):
+    def StartEngine( self, sceneFrame = None ):
+        self.scene_frame = sceneFrame
         self.Show()
         self.engine.beginRendering(False)
 

Modified: trunk/scenes/csafe/python/csafe_scene.py
==============================================================================
--- trunk/scenes/csafe/python/csafe_scene.py    (original)
+++ trunk/scenes/csafe/python/csafe_scene.py    Mon Apr  6 17:21:54 2009
@@ -292,6 +292,11 @@
     def MenuQuit(self, e):
         self.Close()
 
+    ################ shutDown #################
+    def shutDown(self):
+        self.scene.mantaApp.frame.Destroy()
+        self.Destroy()
+
     ################ OnCloseWindow #################
     def OnCloseWindow(self, evt):
         self.scene.mantaApp.frame.ShutdownEngine()
@@ -381,7 +386,8 @@
         self.slider.SetRange(1, self.scene.numFrames)
         self.slider.SetValue(1)
         self.numFramesTxt.SetLabel(" / " + str(self.scene.numFrames))
-        self.scene.mantaApp.frame.StartEngine()
+
+        self.scene.mantaApp.frame.StartEngine( self )
         
         if self.scene.numFrames > 1:
            self.forwardB.Enable(True)
@@ -440,8 +446,10 @@
 
     def OnClick(self, evt):
         None
+
     def OnKeyDown(self, event):
         None
+
     def OnClickColor(self, evt):
         dlg = wx.ColourDialog(self)
         dlg.GetColourData().SetChooseFull(True)
@@ -450,6 +458,7 @@
             color = dlg.GetColourData()
             
         dlg.Destroy()
+
     def OnClickVisible(self, evt):
         if self.visible:
             self.sizer.ShowItems(False)


  • [Manta] r2394 - in trunk: SwigInterface scenes/csafe/python, dav, 04/06/2009

Archive powered by MHonArc 2.6.16.

Top of page