wxSplitterWindow Member Functions
These are the major
are accessors for the mini-
mum pane size. The default minimum pane size is zero, which means that
either pane can be reduced to zero by dragging the sash, thus removing one of
the panes. To prevent this behavior (and veto out-of-range sash dragging), set
a minimum size, for example 20 pixels. However, if the
style is used when a splitter window is created, the window may be unsplit
even if the minimum size is non-zero.
are accessors for the sash position.
Passing true to
resizes the pane and redraws the sash and border.
are accessors for the split orientation,
which can be
get the pointers to the two panes.
can be called with a pointer to a window if you only want to
have one pane initially.
tests whether the window is split.
replaces one of the windows managed by the
with another one. Generally, it’s better to use this function instead of
and then resplitting the window.
takes a floating-point argument, which determines the
position of the sash as the window is resized. A value of 0.0 (the default)
means that only the bottom or right child window will be resized, and a value
of 1.0 means that only the top or left child window will be resized. Values inbe-
tween indicate that the change in size should be distributed between both
child windows (a value of 0.5 distributes the size evenly). Use
to return the current setting.
initialize the splitter window with
two panes and optionally an initial sash size.
removes the specified pane.
causes the splitter to update its sash position immediately
(normally, this is done in idle time).
Sizing Issues with wxSplitterWindow
There are subtleties to be aware of when using a splitter window as part of a
sizer hierarchy. If you don’t need the sash to be moveable, you can create both
child windows with absolute sizes.This will fix the minimum size of both child
windows, and the sash will therefore not be free to move. If you need the sash
to be moveable, as is normally the case, pass default values to the child win-
dows and specify an initial minimum size in the splitter window constructor.
Then add the splitter window to its sizer, passing the
,which tells wxWidgets to treat the specified size as the minimum size.
Another issue is that a splitter does not set its sash position (and there-
fore the sizes of its child windows) until idle time, when it can be sure that sizing
Window Basics Chapter 4