From: Robin Dunn Date: Sat, 7 Aug 2004 03:02:00 +0000 (+0000) Subject: Hide the page before adjusting its size, otherwise it might get painted X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e830a6a64d8fdfa9ab7e1ea313e41709bf746307 Hide the page before adjusting its size, otherwise it might get painted git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 7e3bbcbd49..7057d019ed 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -613,6 +613,16 @@ bool wxNotebook::InsertPage(size_t nPage, tcItem.pszText = (wxChar *)strText.c_str(); // const_cast } + // hide the page: unless it is selected, it shouldn't be shown (and if it + // is selected it will be shown later) + HWND hwnd = GetWinHwnd(pPage); + SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VISIBLE); + + // this updates internal flag too -- otherwise it would get out of sync + // with the real state + pPage->Show(false); + + // fit the notebook page to the tab control's display area: this should be // done before adding it to the notebook or TabCtrl_InsertItem() will // change the notebooks size itself! @@ -638,16 +648,6 @@ bool wxNotebook::InsertPage(size_t nPage, AdjustPageSize(pPage); } - // hide the page: unless it is selected, it shouldn't be shown (and if it - // is selected it will be shown later) - HWND hwnd = GetWinHwnd(pPage); - SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VISIBLE); - - // this updates internal flag too -- otherwise it would get out of sync - // with the real state - pPage->Show(false); - - // now deal with the selection // ---------------------------