From a496a72d6651449ffcab6d76f182edb14e2f9141 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Nov 2011 15:46:01 +0000 Subject: [PATCH] Only update status bar fields after they were created in wxMSW. Postpone updating statu bar panes after they were actually created. Setting the status bar fields contents before setting the number of them failed resulting in debug error messages and the text not appearing in the status bar. Closes #13670. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/statusbar.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index b82db9553b..7bfb81bc9d 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -229,12 +229,11 @@ void wxStatusBar::MSWUpdateFieldsWidths() int *pWidths = new int[count]; int nCurPos = 0; - for ( int i = 0; i < count; i++ ) + int i; + for ( i = 0; i < count; i++ ) { nCurPos += widthsAbs[i] + extraWidth; pWidths[i] = nCurPos; - - DoUpdateStatusText(i); } // The total width of the panes passed to Windows must be equal to the @@ -247,6 +246,12 @@ void wxStatusBar::MSWUpdateFieldsWidths() wxLogLastError("StatusBar_SetParts"); } + // Now that all parts have been created, set their text. + for ( i = 0; i < count; i++ ) + { + DoUpdateStatusText(i); + } + delete [] pWidths; } -- 2.45.2