#
# o Updated for wx namespace
#
-# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o OGL's busted bigtime. Can't even use OGLInitialize() without a
-# program error on w2k.
-#
import wx
import wx.ogl as ogl
##wx.Trap()
-#----------------------------------------------------------------------
-# This creates some pens and brushes that the OGL library uses.
-
-ogl.OGLInitialize()
-
#----------------------------------------------------------------------
class DiamondShape(ogl.PolygonShape):
# for some reason, the shapes have to be moved for the line to show up...
fromShape.Move(dc, fromShape.GetX(), fromShape.GetY())
- wx.EVT_WINDOW_DESTROY(self, self.OnDestroy)
+ self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
def MyAddShape(self, shape, x, y, pen, brush, text):
#----------------------------------------------------------------------
+# The OGL library holds some resources that need to be freed before
+# the app shuts down.
class __Cleanup:
- cleanup = ogl.OGLCleanUp
- def __del__(self):
- self.cleanup()
+ def __del__(self, cleanup=ogl.OGLCleanUp):
+ cleanup()
-# when this module gets cleaned up then wxOGLCleanUp() will get called
+# When this module gets cleaned up by Python then __cu will be cleaned
+# up and it's __dell__ is called, which will then call ogl.OGLCleanUp.
__cu = __Cleanup()
if __name__ == '__main__':
import sys,os
import run
- run.main(['', os.path.basename(sys.argv[0])])
+ run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])