]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/SplitTree.py
removed WXWIN_COMPATIBILITY_2_4 from common and wxMSW files (patch 1675546)
[wxWidgets.git] / wxPython / demo / SplitTree.py
index 9f12a935bcd7c2f6fa9bff0b05460c0ec0408793..3356ad2f3bfb7b680dd16303b5a6005675a209b6 100644 (file)
@@ -16,7 +16,6 @@
 import  wx
 import  wx.gizmos as gizmos
 
-import  images
 
 #----------------------------------------------------------------------
 
@@ -27,8 +26,8 @@ class TestTree(gizmos.RemotelyScrolledTreeCtrl):
         # make an image list
         im1 = im2 = -1
         self.il = wx.ImageList(16, 16)
-        im1 = self.il.Add(images.getFolder1Bitmap())
-        im2 = self.il.Add(images.getFile1Bitmap())
+        im1 = self.il.Add(wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_TOOLBAR, (16,16)))
+        im2 = self.il.Add(wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR, (16,16)))
         self.SetImageList(self.il)
 
         # Add some items
@@ -48,10 +47,6 @@ class TestValueWindow(gizmos.TreeCompanionWindow):
     def __init__(self, parent, style=0):
         gizmos.TreeCompanionWindow.__init__(self, parent, -1, style=style)
         self.SetBackgroundColour("WHITE")
-        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OEB)
-
-    def OEB(self, evt):
-        pass
 
     # This method is called to draw each item in the value window
     def DrawItem(self, dc, itemId, rect):
@@ -85,7 +80,7 @@ class TestValueWindow(gizmos.TreeCompanionWindow):
 
 class TestPanel(wx.Panel):
     def __init__(self, parent, log):
-        wx.Panel.__init__(self, parent, -1)
+        wx.Panel.__init__(self, parent, -1, size=(640,480))
         self.log = log
 
         scroller = gizmos.SplitterScrolledWindow(
@@ -105,7 +100,7 @@ class TestPanel(wx.Panel):
 
         valueWindow = TestValueWindow(splitter, style=wx.NO_BORDER)
 
-        splitter.SplitVertically(tree, valueWindow, 150)
+        wx.CallAfter(splitter.SplitVertically, tree, valueWindow, 150)
         scroller.SetTargetWindow(tree)
         scroller.EnableScrolling(False, False)
 
@@ -114,16 +109,17 @@ class TestPanel(wx.Panel):
 
         sizer = wx.BoxSizer(wx.VERTICAL)
         sizer.Add(scroller, 1, wx.EXPAND|wx.ALL, 25)
-        self.SetAutoLayout(True)
         self.SetSizer(sizer)
-
+        self.Layout()
 
 #----------------------------------------------------------------------
 
 def runTest(frame, nb, log):
     if wx.Platform == "__WXMAC__":
-        wx.MessageBox("This demo currently fails on the Mac. The problem is being looked into...", "Sorry")
-        return
+        from Main import MessagePanel
+        win = MessagePanel(nb, 'This demo currently fails on the Mac. The problem is being looked into...',
+                           'Sorry', wx.ICON_WARNING)
+        return win
 
     win = TestPanel(nb, log)
     return win