1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
.. include:: headings.inc
.. _splitterwindow overview:
=================================================
|phoenix_title| **Splitter Windows Overview**
=================================================
The following screenshot shows the appearance of a splitter window
with a horizontal split.
The style ``wx.SP_3D`` has been used to show a 3D border and 3D sash.
.. figure:: _static/images/overviews/overview_splitter_3d.png
:align: center
Example
-------
The following fragment shows how to create a splitter window, creating
two subwindows and hiding one of them::
splitter = wx.SplitterWindow(self, -1, wx.Point(0, 0),
wx.Size(400, 400), wx.SP_3D)
leftWindow = MyWindow(splitter)
leftWindow.SetScrollbars(20, 20, 50, 50)
rightWindow = MyWindow(splitter)
rightWindow.SetScrollbars(20, 20, 50, 50)
rightWindow.Show(False)
splitter.Initialize(leftWindow)
# Set this to prevent unsplitting
# splitter.SetMinimumPaneSize(20)
The next fragment shows how the splitter window can be manipulated
after creation::
def OnSplitVertical(self, event):
if splitter.IsSplit():
splitter.Unsplit()
leftWindow.Show(True)
rightWindow.Show(True)
splitter.SplitVertically(leftWindow, rightWindow)
def OnSplitHorizontal(self, event):
if splitter.IsSplit():
splitter.Unsplit()
leftWindow.Show(True)
rightWindow.Show(True)
splitter.SplitHorizontally(leftWindow, rightWindow)
def OnUnsplit(self, event):
if splitter.IsSplit():
splitter.Unsplit()
|