Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1975 - trunk/SwigInterface


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1975 - trunk/SwigInterface
  • Date: Mon, 7 Jan 2008 15:35:51 -0700 (MST)

Author: abe
Date: Mon Jan  7 15:35:50 2008
New Revision: 1975

Modified:
   trunk/SwigInterface/runwxmanta.py
   trunk/SwigInterface/wxManta.py
Log:

Moved the wxpython version selection code into the example template
script. Now other applications (like the csafe volume renderer) can
use whatever version of wxpython they'd like.

M    wxManta.py
M    runwxmanta.py


Modified: trunk/SwigInterface/runwxmanta.py
==============================================================================
--- trunk/SwigInterface/runwxmanta.py   (original)
+++ trunk/SwigInterface/runwxmanta.py   Mon Jan  7 15:35:50 2008
@@ -1,8 +1,19 @@
+#!/usr/bin/python
 
-import wxManta
-import getopt, sys
+# Manta/wxPython example script. This script demonstrates how to use
+# features of the wxManta GUI. Make a copy and modify it to fit your
+# own application.
+
+import sys
+import getopt
 import re
 
+# The first two lines are optional, use them if your application requires a 
specific version of wx.
+import wxversion
+wxversion.ensureMinimal('2.5.3') # or for example: wxversion.select("2.5")
+import wx
+
+import wxManta
 from manta import *
 
 def usage():

Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py      (original)
+++ trunk/SwigInterface/wxManta.py      Mon Jan  7 15:35:50 2008
@@ -1,17 +1,11 @@
 #!/usr/bin/python
 
-import wxversion
-# This will barf and give warnings if you don't have a new enough version.
-wxversion.ensureMinimal('2.5.3')
-# This will select a particular version if you have more than one installed.
-#wxversion.select("2.5")
-
-import wx
 import sys
 import getopt
 import time
 import string
 import re
+import wx
 
 from wx import glcanvas
 import FloatSpin as FS
@@ -284,64 +278,64 @@
         # Create the menu
         self.menuBar = wx.MenuBar()
 
-        manta_menu = wx.Menu()
+        self.manta_menu = wx.Menu()
         self.Bind(wx.EVT_MENU, self.OnAbout,
-                  manta_menu.Append(wx.NewId(), "About Manta"))
+                  self.manta_menu.Append(wx.NewId(), "About Manta"))
 
         # Threads.
         dialog_id = wx.NewId()
         self.dialog_map[dialog_id] = ThreadsFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
-                  manta_menu.Append(dialog_id, "Threads"))
+                  self.manta_menu.Append(dialog_id, "Threads"))
 
         # Python Shell
         dialog_id = wx.NewId()
         self.dialog_map[dialog_id] = MantaShellFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
-                  manta_menu.Append(dialog_id, "Python Shell"))
+                  self.manta_menu.Append(dialog_id, "Python Shell"))
 
         
         self.Bind(wx.EVT_MENU, self.OnCloseWindow,
-                  manta_menu.Append(wx.NewId(), "&Quit Manta"))
-        self.menuBar.Append(manta_menu, "&Manta")
+                  self.manta_menu.Append(wx.NewId(), "&Quit Manta"))
+        self.menuBar.Append(self.manta_menu, "&Manta")
         
-        file_menu = wx.Menu()
+        self.file_menu = wx.Menu()
         self.Bind(wx.EVT_MENU, self.OnImportPython,
-                  file_menu.Append(wx.NewId(), "Import &Python"))
-        self.menuBar.Append(file_menu, "&File")
+                  self.file_menu.Append(wx.NewId(), "Import &Python"))
+        self.menuBar.Append(self.file_menu, "&File")
         
-        view_menu = wx.Menu()
+        self.view_menu = wx.Menu()
         self.Bind(wx.EVT_MENU, self.OnAutoView,
-                  view_menu.Append(wx.NewId(), "&Auto View"))
+                  self.view_menu.Append(wx.NewId(), "&Auto View"))
 
         # Edit camera dialog.
         dialog_id = wx.NewId()
         self.dialog_map[dialog_id] = CameraFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
-                  view_menu.Append(dialog_id, "Edit Camera"))
+                  self.view_menu.Append(dialog_id, "Edit Camera"))
 
         # Camera Path dialog.
         dialog_id = wx.NewId()
         self.dialog_map[dialog_id] = MantaCameraPathFrame
         self.Bind( wx.EVT_MENU, self.OnShowDialog,
-                   view_menu.Append(dialog_id, "Camera Paths"))
+                   self.view_menu.Append(dialog_id, "Camera Paths"))
 
         # Capture frames dialog.
         dialog_id = wx.NewId()
         self.dialog_map[dialog_id] = MantaCaptureFrame
         self.Bind( wx.EVT_MENU, self.OnShowDialog,
-                   view_menu.Append(dialog_id, "Capture Frames"))
+                   self.view_menu.Append(dialog_id, "Capture Frames"))
 
-        self.menuBar.Append(view_menu, "&Camera")
+        self.menuBar.Append(self.view_menu, "&Camera")
 
         # Edit ligts.
-        light_menu = wx.Menu()
+        self.light_menu = wx.Menu()
         
         light_dialog_id = wx.NewId()
         self.dialog_map[light_dialog_id] = LightFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog,
-                  light_menu.Append(light_dialog_id, "Edit Lights"))
-        self.menuBar.Append(light_menu, "&Lights")
+                  self.light_menu.Append(light_dialog_id, "Edit Lights"))
+        self.menuBar.Append(self.light_menu, "&Lights")
 
 
         self.SetMenuBar(self.menuBar)
@@ -898,6 +892,7 @@
                  renderSize  = wx.Size(xres,yres),
                  redirect=False,
                  filename=None,
+                 commandLine=[], # Unused
                  begin_rendering=True):
         wx.App.__init__(self, redirect, filename)
 




  • [Manta] r1975 - trunk/SwigInterface, abe, 01/07/2008

Archive powered by MHonArc 2.6.16.

Top of page