]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/wxSplitterWindow.py
1. Grid cell defaults are now handled by an internal
[wxWidgets.git] / utils / wxPython / demo / wxSplitterWindow.py
index 20b4929c60301433a11dd182b97d2cb69ff5f621..662975b5f8ddc0e7e600b9c249dcba48523378fb 100644 (file)
@@ -2,10 +2,21 @@
 from wxPython.wx import *
 
 
+#---------------------------------------------------------------------------
+
+class MySplitter(wxSplitterWindow):
+    def __init__(self, parent, ID, log):
+        wxSplitterWindow.__init__(self, parent, ID)
+        self.log = log
+        EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(), self.OnSashChanged)
+
+    def OnSashChanged(self, evt):
+        self.log.WriteText("sash changed to " + str(evt.GetSashPosition()))
+
 #---------------------------------------------------------------------------
 
 def runTest(frame, nb, log):
-    splitter = wxSplitterWindow(nb, -1)
+    splitter = MySplitter(nb, -1, log)
 
     p1 = wxWindow(splitter, -1)
     p1.SetBackgroundColour(wxRED)
@@ -15,9 +26,9 @@ def runTest(frame, nb, log):
     p2.SetBackgroundColour(wxBLUE)
     wxStaticText(p2, -1, "Panel Two", wxPoint(5,5)).SetBackgroundColour(wxBLUE)
 
+    splitter.SetMinimumPaneSize(20)
     splitter.SplitVertically(p1, p2)
     splitter.SetSashPosition(100)
-    splitter.SetMinimumPaneSize(20)
 
     return splitter