From: Robin Dunn Date: Thu, 1 Apr 2004 19:23:12 +0000 (+0000) Subject: The reinit of the stock objects shoudl not happen when wxPython is X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/70e45c91bb677a3fe7eb8152f3c89c08cb0b2496 The reinit of the stock objects shoudl not happen when wxPython is embedded in a C++ wx application git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 6bcefc228d..7ad042c032 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -723,6 +723,16 @@ void wxPy_ReinitStockObjects(int pass) else if (pass == 2) { rsoPass2(#name); } \ else if (pass == 3) { rsoPass3(#name, #classname, (void*)&name); } + // If there is already an App object then wxPython is probably embedded in + // a wx C++ application, so there is no need to do all this. + static bool embedded = false; + if ((pass == 1 || pass == 2) && wxTheApp) { + embedded = true; + return; + } + if (pass == 3 && embedded) + return; + REINITOBJ(wxNORMAL_FONT, wxFont); REINITOBJ(wxSMALL_FONT, wxFont);