From 0415f0ab05cce1ee84dc05ee8f1cb58e46aeac9a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Feb 2014 14:54:31 +0000 Subject: [PATCH] Document interaction of wxSplitterWindow gravity with initial size. Document the somewhat counter intuitive (but difficult to change) behaviour of the splitter when both sash position and gravity are set. See #15996. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/splitter.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interface/wx/splitter.h b/interface/wx/splitter.h index be922f1089..494bc40d2e 100644 --- a/interface/wx/splitter.h +++ b/interface/wx/splitter.h @@ -324,6 +324,15 @@ public: That value is compatible with previous (before gravity was introduced) behaviour of wxSplitterWindow. + Notice that when sash gravity for a newly created splitter window, it + is often necessary to explicitly set the splitter size using SetSize() + 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() */ void SetSashGravity(double gravity);