1

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?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
Stomp
  • 890
  • 1
  • 6
  • 19

1 Answers1

2

Checkout wxSplitterWindow::SetSashGravity in the docs:

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

Tamer
  • 876
  • 2
  • 10
  • 22
  • Tamer, Thanks for the reply! In the XRC editor (DialogBlocks), I set the gravity to 1 and the sash position to -120, which looked correct there, but when I ran the app, the right window was only a few pixels wide. I had to do a SetSashPosition(-120) in the app to make it work. Any ideas on that? – Stomp Nov 13 '12 at 14:54
  • Setting the sash position initially is sometimes tricky depending on any sizer code. Sometimes you need to do it after your app's main frame is shown, then it works. – Tamer Nov 14 '12 at 17:20