AGW Logo

agw_title fourwaysplitter

FourWaySplitter is a layout manager which manages 4 children like 4 panes in a window.

description Description

The FourWaySplitter is a layout manager which manages four children like four panes in a window. You can use a four-way splitter for example in a CAD program where you may want to maintain three orthographic views, and one oblique view of a model.

The FourWaySplitter allows interactive repartitioning of the panes by means of moving the central splitter bars. When the FourWaySplitter is itself resized, each child is proportionally resized, maintaining the same split-percentage.

The main characteristics of FourWaySplitter are:

  • Handles horizontal, vertical or four way sizing via the sashes;
  • Delayed or live update when resizing;
  • Possibility to swap windows;
  • Setting the vertical and horizontal split fractions;
  • Possibility to expand a window by hiding the onther 3.

And a lot more. See the demo for a complete review of the functionalities.

usage Usage

Usage example:

import wx
import wx.lib.agw.fourwaysplitter as fws

class MyFrame(wx.Frame):

    def __init__(self, parent):

        wx.Frame.__init__(self, parent, -1, "FourWaySplitter Demo")

        splitter = fws.FourWaySplitter(self, -1, agwStyle=wx.SP_LIVE_UPDATE)

        # Put in some coloured panels...
        for colour in [wx.RED, wx.WHITE, wx.BLUE, wx.GREEN]:

            panel = wx.Panel(splitter)


# our normal wxApp-derived class, as usual

app = wx.PySimpleApp()

frame = MyFrame(None)


This code snippet can be downloaded, see this example script.


Some of the AGW snippets of code in the documentation use images and external files (to create bitmaps or access external data). As these files are not provided in these snippets, you should make the approriate modifications to the code to actually run it.

platforms Supported Platforms

FourWaySplitter has been tested on the following platforms:
  • Windows (Windows XP);
  • Linux Ubuntu (Dapper 6.06)

styles Window Styles

This class supports the following window styles:

Window styles for fourwaysplitter
Window Styles Hex Value Description
SP_NOSASH 0x10 No sash will be drawn on FourWaySplitter.
SP_LIVE_UPDATE 0x80 Don’t draw XOR line but resize the child windows immediately.
SP_3DBORDER 0x200 Draws a 3D effect border.

events Events Processing

This class processes the following events:

Events processing for fourwaysplitter
Event Name Description
EVT_SPLITTER_SASH_POS_CHANGED The sash position was changed. This event is generated after the user releases the mouse after dragging the splitter. Processes a wx.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED event.
EVT_SPLITTER_SASH_POS_CHANGING The sash position is in the process of being changed. You may prevent this change from happening by calling Veto or you may also modify the position of the tracking bar to properly reflect the position that would be set if the drag were to be completed at this point. Processes a wx.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING event.

license License And Version

FourWaySplitter is distributed under the wxPython license.

Latest Revision: Andrea Gavana @ 17 Aug 2011, 15.00 GMT

Version 0.4

Module author: Andrea Gavana <>

hierarchy Inheritance Diagram

Inheritance diagram for module: fourwaysplitter

Inheritance diagram of fourwaysplitter.FourWaySplitter, fourwaysplitter.FourWaySplitterEvent

svn_main SVN Revisions

A graphical representation of the SVN commits in the last year.

Click on any date in the picture to jump to that particular revision page, containing information about committers, log messages and SVN diffs.


Revision Graph For fourwaysplitter

2to3 Python 3 Issues (via 2to3)

No issues have been detected by