]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Listbook.py
Fix "warning: operation on 'y' may be undefined".
[wxWidgets.git] / wxPython / demo / Listbook.py
index 2186205cb3e7aae2e88fbbf3560c5ce20a54b940..20115cbf6038e3a153fc0f3f31c21a0d461376af 100644 (file)
@@ -1,35 +1,12 @@
-# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-# 
-# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Bunches of imports that might need to go away for the final roll-out.
-# 
-
-import  sys
 
 import  wx
 
-import images
-
 import ColorPanel
+import images
 
 colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blue",
                "Coral", "Cornflower Blue", "Cyan", "Dark Grey", "Dark Green",
-               "Dark Olive Green", "Dark Orchid", "Dark Slate Blue",
-               "Dark Slate Grey", "Dark Turquoise", "Dim Grey", "Firebrick",
-               "Forest Green", "Gold", "Goldenrod", "Grey", "Green", "Green Yellow",
-               "Indian Red", "Khaki", "Light Blue", "Light Grey", "Light Steel Blue",
-               "Lime Green", "Magenta", "Maroon", "Medium Aquamarine", "Medium Blue",
-               "Medium Forest Green", "Medium Goldenrod", "Medium Orchid",
-               "Medium Sea Green", "Medium Slate Blue", "Medium Spring Green",
-               "Medium Turquoise", "Medium Violet Red", "Midnight Blue", "Navy",
-               "Orange", "Orange Red", "Orchid", "Pale Green", "Pink", "Plum",
-               "Purple", "Red", "Salmon", "Sea Green", "Sienna", "Sky Blue",
-               "Slate Blue", "Spring Green", "Steel Blue", "Tan", "Thistle",
-               "Turquoise", "Violet", "Violet Red", "Wheat", "White", "Yellow",
-               "Yellow Green"
+               "Dark Olive Green",
                ]
 
 #----------------------------------------------------------------------------
@@ -45,11 +22,10 @@ class TestLB(wx.Listbook):
                             )
         self.log = log
 
-
-        # make an image list using the BlomXX images
+        # make an image list using the LBXX images
         il = wx.ImageList(32, 32)
-        for x in range(1, 15):
-            f = getattr(images, 'getBlom%02dBitmap' % x)
+        for x in range(12):
+            f = getattr(images, 'getLB%02dBitmap' % (x+1))
             bmp = f()
             il.Add(bmp)
         self.AssignImageList(il)
@@ -67,14 +43,10 @@ class TestLB(wx.Listbook):
                           "You can put nearly any type of window here,\n"
                           "and the list can be on any side of the Listbook",
                           wx.Point(10, 10))
-                #st.SetForegroundColour(wxWHITE)
-                #st.SetBackgroundColour(wxBLUE)
                 first = False
-            
-                
 
-        wx.EVT_LISTBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged)
-        wx.EVT_LISTBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging)
+        self.Bind(wx.EVT_LISTBOOK_PAGE_CHANGED, self.OnPageChanged)
+        self.Bind(wx.EVT_LISTBOOK_PAGE_CHANGING, self.OnPageChanging)
 
 
     def makeColorPanel(self, color):
@@ -112,10 +84,10 @@ def runTest(frame, nb, log):
 
 overview = """\
 <html><body>
-<h2>wxListbook</h2>
+<h2>wx.Listbook</h2>
 <p>
 This class is a control similar to a notebook control, but with a
-wxListCtrl instead of a set of tabs.
+wx.ListCtrl instead of a set of tabs.
 
 """
 
@@ -124,6 +96,7 @@ wxListCtrl instead of a set of tabs.
 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:])
+