Search code examples
luawxwidgetsxrcwxlua

wxLua splitter window on resize


In the image snippet below, there is a splitter-sash between the tan Output window and the blue Command Line Args window. The user can change the width of the blue window (by dragging the splitter sash) if desired, but I want the blue window to maintain its width if the app is resized, that is, the tan window does all the horizontal shrinking and growing.

image

In my XRC file for the app, I have a BoxSizerH containing a vertical splitter. The splitter holds two panels. Each panel contains a StaticBoxSizerV holding a multi-line text control.

What must I do to allow the user to fix the width of the right-most window?

Do I need to trap resizes and set the sash position to maintain the last trapped splitter drag, or is there an easier way just using initial settings?


Solution

  • Checkout wxSplitterWindow::SetSashGravity in the docs:

    http://docs.wxwidgets.org/trunk/classwx_splitter_window.html#a3c52925dffd02509d110086d4bb29373