X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0dba08dd3987303ff116bf77d5fb877b6d8f32d0..6d0d84554854a19db991ba64e7e034e1fc898ef0:/src/msw/statusbar.cpp diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index 69826207de..4baebc470b 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -125,7 +125,11 @@ bool wxStatusBar::Create(wxWindow *parent, // we must refresh the frame size when the statusbar is created, because // its client area might change - SendSizeEventToParent(); + // + // notice that we must post the event, not send it, as the frame doesn't + // know that we're its status bar yet so laying it out right now wouldn't + // work correctly, we need to wait until we return to the main loop + PostSizeEventToParent(); return true; } @@ -135,7 +139,7 @@ wxStatusBar::~wxStatusBar() // we must refresh the frame size when the statusbar is deleted but the // frame is not - otherwise statusbar leaves a hole in the place it used to // occupy - SendSizeEventToParent(); + PostSizeEventToParent(); } void wxStatusBar::SetFieldsCount(int nFields, const int *widths)