X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526954c5968baa29218c994ec48e476ae2bd4b9f..81f2b2ee81ce76fdc826e2740713e6fbefbfd5b3:/samples/splitter/splitter.cpp diff --git a/samples/splitter/splitter.cpp b/samples/splitter/splitter.cpp index cd05d8ab88..1884138e60 100644 --- a/samples/splitter/splitter.cpp +++ b/samples/splitter/splitter.cpp @@ -39,7 +39,7 @@ #include "wx/splitter.h" #include "wx/dcmirror.h" -#ifndef __WXMSW__ +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif @@ -257,6 +257,12 @@ MyFrame::MyFrame() menuBar->Check(SPLIT_LIVE, true); m_splitter = new MySplitterWindow(this); + // If you use non-zero gravity you must initialize the splitter with its + // correct initial size, otherwise it will change the sash position by a + // huge amount when it's resized from its initial default size to its real + // size when the frame lays it out. This wouldn't be necessary if default + // zero gravity were used (although it would do no harm neither). + m_splitter->SetSize(GetClientSize()); m_splitter->SetSashGravity(1.0); #if 1