]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ColourDB.py
better __docfilter__ and other epydoc tweaks
[wxWidgets.git] / wxPython / demo / ColourDB.py
index 1680c31a9d8a77feba9dfe73a9b4a0c293666f11..e00652c734d3cf25cda6f7b9b32893f1383a1475 100644 (file)
@@ -18,10 +18,6 @@ class TestWindow(wx.ScrolledWindow):
         #self.clrList.sort()
         self.bg_bmp = images.getGridBGBitmap()
 
-        # Event handlers
-        self.Bind(wx.EVT_PAINT, self.OnPaint)
-        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
-
         # This could also be done by getting the window's default font;
         # either way, we need to have a font loaded for later on.
         #self.SetBackgroundColour("WHITE")
@@ -54,6 +50,11 @@ class TestWindow(wx.ScrolledWindow):
         self.SetScrollbars(
             self.cellWidth, self.lineHeight, numCells, len(self.clrList) + 2
             )
+            
+        # Event handlers - moved here so events won't fire before init is 
+        # finished.
+        self.Bind(wx.EVT_PAINT, self.OnPaint)
+        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
 
 
     # tile the background bitmap loaded in __init__()
@@ -196,5 +197,5 @@ Trying to do otherwise will cause an exception to be raised.
 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:])