The SplitView wraps Cocoa’s NSSplitView. When you instantiate it, you tell it how many subviews it has, and then populate those subviews. Example:
split = SplitView(window, 3, vertical=True)
label1 = Label(split.subviews[0], "First Split")
label2 = Label(split.subviews[1], "Second Split")
label3 = Label(split.subviews[2], "Third Split")
Parameters: |
|
---|
Boolean. Whether the split dividers are vertical. Equivalent to [self isVertical].
Cocoa constant. Style of the dividers. Use NSSplitViewDividerStyle constants.
If you create a split view in a way similar to the example above, you’ll have a split view populated by plain NSView instances which will then be the parent the views you’re going to put in them. Sometimes (and even often), you rather want to put your view directly in the split view. In these cases, set the initial splitCount to 0 and create your views with the split directly as a parent, like this:
split = SplitView(window, 0, vertical=True)
label1 = Label(split, "First Split")
label2 = Label(split, "Second Split")
label3 = Label(split, "Third Split")
The order in which you create your subviews will then be very important because it will determine the order of the views in the split.