wxSplitterWindow(3)
πΈ wxSplitterWindow π
okay bestie, this one lives in the Erlang Module Definition corner of the wx universe and it's literally the girl who runs the whole "two panels, one window" thing. she ate.
β¨ NAME β¨
wxSplitterWindow β this class manages up to two subwindows. two. that's it. she's a two-pane queen and she knows it. π«Ά
π¦ DESCRIPTION π¦
so here's the vibe: the current view can be split into two programmatically (like, maybe from a menu command, iykyk), and unsplit either programmatically or via the wxSplitterWindow user interface. either way, she's got you. π
π Styles π
not her having a whole wardrobe?? yes. this class supports the following styles:
wxSP_3Dβ draws a 3D effect border and a sash. two-for-one, iconic. β¨wxSP_THIN_SASHβ a thin sash. she's on a diet, she's dainty, she's serving minimalism. πΈwxSP_3DSASHβ draws a 3D effect sash (and heads up, this one is part of the default style). πwxSP_3DBORDERβ just a synonym forwxSP_BORDER. same girl, different name tag. πwxSP_BORDERβ draws a standard border. classic, no notes. πwxSP_NOBORDERβ no border at all. this is the default, so if you didn't ask for anything, you got the naked version, bestie. πwxSP_NO_XP_THEMEβ under Windows, this switches off the attempt to draw the splitter using Windows theming, so the borders and sash take on that pre-XP look. vintage era, lowkey retro. βwxSP_PERMIT_UNSPLITβ always allow unsplitting, even when the minimum pane size is something other than zero. she said "I will let you close me no matter what." πwxSP_LIVE_UPDATEβ don't draw that XOR line, just resize the child windows immediately. instant gratification, no lag, main character energy. π₯
See:
wxSplitterEvent- Overview splitterwindow
π THE FAMILY TREE π
this class is derived, and can use functions, from:
wxWindowwxEvtHandler
she got it from her mamas, periodt. π
wxWidgets docs: wxSplitterWindow
π Events π
event types emitted from this class:
command_splitter_sash_pos_changingcommand_splitter_sash_pos_changedcommand_splitter_unsplit
three little notifications, all in a row, like a group chat going off at 2am. π¦
π§ DATA TYPES π§
wxSplitterWindow() :: wx:wx_object().
that's the type signature, bestie β literally just a wx:wx_object(). no cap. β¨
β¨ FUNCTIONS β¨
create/3
create(This, Parent, [Option]) -> boolean()
when
This :: wxSplitterWindow(),
Parent :: wxWindow:wxWindow(),
Option ::
{id, integer()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()}.
Creation function, bestie β for that two-step construction moment. Details live in new/2, okay? π
destroy/1
destroy(This :: wxSplitterWindow()) -> ok.
Literally yeets the object into the void. Bye boo π«Άπ
getMinimumPaneSize/1
getMinimumPaneSize(This) -> integer()
when This :: wxSplitterWindow().
Returns the current minimum pane size β and yeah, it defaults to zero. See setMinimumPaneSize/2 for the tea β
getSashGravity/1
getSashGravity(This) -> number() when This :: wxSplitterWindow().
Returns the current sash gravity, periodt. See setSashGravity/2 β¨
getSashPosition/1
getSashPosition(This) -> integer() when This :: wxSplitterWindow().
Returns the current sash position. See setSashPosition/3 πΈ
getSplitMode/1
getSplitMode(This) -> wx:wx_enum() when This :: wxSplitterWindow().
Gets the split mode, iconic behaviour only.
See:
setSplitMode/2splitVertically/4splitHorizontally/4
getWindow1/1
getWindow1(This) -> wxWindow:wxWindow()
when This :: wxSplitterWindow().
Returns the left/top pane β or if there's just one pane, that one. Main character energy π
getWindow2/1
getWindow2(This) -> wxWindow:wxWindow()
when This :: wxSplitterWindow().
Returns the right/bottom pane. The supporting cast, but make it fashion π
initialize/2
initialize(This, Window) -> ok
when
This :: wxSplitterWindow(),
Window :: wxWindow:wxWindow().
Initializes the splitter window to have exactly one pane. The child window gets shown if it was currently hidden, no cap.
Remark: call this if you wanna initially view only a single pane in the splitter window. Lowkey essential.
See:
splitVertically/4splitHorizontally/4
isSplit/1
isSplit(This) -> boolean() when This :: wxSplitterWindow().
Returns true if the window is split, false otherwise. Simple as that, bestie π
new/0
new() -> wxSplitterWindow().
Default constructor. It's giving basic but necessary β¨
new/2
new(Parent, [Option]) -> wxSplitterWindow()
when
Parent :: wxWindow:wxWindow(),
Option ::
{id, integer()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()}.
Constructor for creating the window, fr fr.
Remark: After using this constructor, you must create either one or two subwindows with the splitter window as parent, and then call one ofinitialize/2,splitVertically/4andsplitHorizontally/4in order to set the pane(s). You can create two windows, with one hidden when not being shown; or you can create and delete the second pane on demand. That's the vibe.
See:
initialize/2splitVertically/4splitHorizontally/4create/3
replaceWindow/3
replaceWindow(This, WinOld, WinNew) -> boolean()
when
This :: wxSplitterWindow(),
WinOld :: wxWindow:wxWindow(),
WinNew :: wxWindow:wxWindow().
This function replaces one of the windows managed by the wxSplitterWindow with another one. Iconic swap energy π
It is in general better to use it instead of calling unsplit/2 and then resplitting the window back because it will provoke much less flicker (if any). It is valid to call this function whether the splitter has two windows or only one.
Both parameters should be non-NULL and winOld must specify one of the windows managed by the splitter. If the parameters are incorrect or the window couldn't be replaced, false is returned. Otherwise the function will return true, but please notice that it will not delete the replaced window and you may wish to do it yourself. Clean up your own mess, bestie π§Ή
See: getMinimumPaneSize/1
setMinimumPaneSize/2
setMinimumPaneSize(This, PaneSize) -> ok
when
This :: wxSplitterWindow(),
PaneSize :: integer().
Sets the minimum pane size.
Remark: 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 behaviour (and veto out-of-range sash dragging), set a minimum size, for example20pixels. If thewxSP_PERMIT_UNSPLITstyle is used when a splitter window is created, the window may be unsplit even if minimum size is non-zero.
See: getMinimumPaneSize/1
setSashGravity/2
setSashGravity(This, Gravity) -> ok
when
This :: wxSplitterWindow(),
Gravity :: number().
Sets the sash gravity. Gravity is the real factor that controls the position of the sash while resizing wxSplitterWindow. Gravity tells wxSplitterWindow how much the left/top window will grow while resizing. Example values, no cap:
0: only the bottom/right window is automatically resized5: both windows grow by equal size0: only left/top window grows Gravity should be a real value between0.0and1.0. Default value of sash gravity is0.0. That value is compatible with previous (before gravity was introduced) behaviour ofwxSplitterWindow.
Notice that when sash gravity for a newly created splitter window, it is often necessary to explicitly set the splitter size using wxWindow:setSize/6 to ensure that is big enough for its initial sash position. Otherwise, i.e. if the window is created with the default tiny size and only resized to its correct size later, the initial sash position will be affected by the gravity and typically result in sash being at the rightmost position for the gravity of 1. See the example code creating wxSplitterWindow in the splitter sample for more details.
See: getSashGravity/1
setSashPosition/3
setSashPosition(This, Position, [Option]) -> ok
when
This :: wxSplitterWindow(),
Position :: integer(),
Option :: {redraw, boolean()}.
Sets the sash position.
Remark: Does not currently check for an out-of-range value. So maybe don't go feral with it π
See: getSashPosition/1
setSplitMode/2
setSplitMode(This, Mode) -> ok
when This :: wxSplitterWindow(), Mode ::
integer().
Sets the split mode.
Remark: Only sets the internal variable; does not update the display. It's giving behind-the-scenes, not front-facing π
See:
getSplitMode/1splitVertically/4splitHorizontally/4
splitHorizontally/4
splitHorizontally(This, Window1, Window2, [Option]) -> boolean()
when
This :: wxSplitterWindow(),
Window1 :: wxWindow:wxWindow(),
Window2 :: wxWindow:wxWindow(),
Option :: {sashPosition, integer()}.
Initializes the top and bottom panes of the splitter window. The child windows are shown if they are currently hidden. So if they were ghosting you, now they're visible π»β‘οΈπ
Return: true if successful, false otherwise (the window was already split).
Remark: This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using isSplit/1.
See:
splitVertically/4isSplit/1unsplit/2
splitVertically/4
splitVertically(This, Window1, Window2, [Option]) -> boolean()
when
This :: wxSplitterWindow(),
Window1 :: wxWindow:wxWindow(),
Window2 :: wxWindow:wxWindow(),
Option :: {sashPosition, integer()}.
Initializes the left and right panes of the splitter window. The child windows are shown if they are currently hidden. Same energy, different axis π¦
Return: true if successful, false otherwise (the window was already split).
Remark: This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using isSplit/1.
See:
splitHorizontally/4isSplit/1unsplit/2
unsplit/2
unsplit(This, [Option]) -> boolean()
when
This :: wxSplitterWindow(),
Option :: {toRemove, wxWindow:wxWindow()}.
Unsplits the window. Breaking up is hard to do, but sometimes necessary π
Return: true if successful, false otherwise (the window was not split).
Remark: This call will not actually delete the pane being removed; it calls OnUnsplit() (not implemented in wx) which can be overridden for the desired behaviour. By default, the pane being removed is hidden.
See:
splitHorizontally/4splitVertically/4isSplit/1
updateSize/1
updateSize(This) -> ok when This :: wxSplitterWindow().
Causes any pending sizing of the sash and child panes to take place immediately. Such resizing normally takes place in idle time, in order to wait for layout to be completed. However, this can cause unacceptable flicker as the panes are resized after the window has been shown. To work around this, you can perform window layout (for example by sending a size event to the parent window), and then call this function, before showing the top-level window. Do it for the plot, bestie π¬
That's the whole vibe, bestie. This page came from Ericsson AB, wx 2.6, and the date on the original footer is wxSplitterWindow(3) β so yeah, iconic documentation energy. Stay slaying those panes πβ¨π§ββοΈ
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms