From d90ce88c330bde5be7af54320893d09504f4d6c0 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Fri, 29 May 2009 18:17:40 +0000 Subject: [PATCH] Added wxPGInitResourceModule(), needed for proper initialization in wxPython bindings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/propgrid/propgrid.h | 4 ++++ src/propgrid/propgrid.cpp | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 93385a47d1..3c6c604055 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -102,6 +102,10 @@ extern WXDLLIMPEXP_PROPGRID wxPGGlobalVarsClass* wxPGGlobalVars; #define wxPGVariant_Bool(A) (A?wxPGVariant_True:wxPGVariant_False) +// When wxPG is loaded dynamically after the application is already running +// then the built-in module system won't pick this one up. Add it manually. +WXDLLIMPEXP_PROPGRID void wxPGInitResourceModule(); + #endif // !SWIG // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 9e38fc6450..cb94580aff 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -154,6 +154,15 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxPGGlobalVarsClassManager, wxModule) +// When wxPG is loaded dynamically after the application is already running +// then the built-in module system won't pick this one up. Add it manually. +void wxPGInitResourceModule() +{ + wxModule* module = new wxPGGlobalVarsClassManager; + module->Init(); + wxModule::RegisterModule(module); +} + wxPGGlobalVarsClass* wxPGGlobalVars = NULL;