X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf694132f1c28509a9f84377ce8d374bae4177ad..3ac8d3bc52ea44d6cb9fdf31fbae175d30d00fcc:/utils/wxPython/demo/wxSplitterWindow.py diff --git a/utils/wxPython/demo/wxSplitterWindow.py b/utils/wxPython/demo/wxSplitterWindow.py index 20b4929c60..662975b5f8 100644 --- a/utils/wxPython/demo/wxSplitterWindow.py +++ b/utils/wxPython/demo/wxSplitterWindow.py @@ -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