From: Robin Dunn Date: Mon, 16 Oct 2006 18:12:17 +0000 (+0000) Subject: Add wxRichTextModuleInit X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f1d6804f7c1a398dd0616ccf15cb0f96ea07f5e0 Add wxRichTextModuleInit git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 557e5b46ca..ed0da6c2c1 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -2015,6 +2015,9 @@ void wxSetFontPreservingStyles(wxTextAttr& attr, const wxFont& font); /// Convert a decimal to Roman numerals wxString wxRichTextDecimalToRoman(long n); + +WXDLLIMPEXP_RICHTEXT void wxRichTextModuleInit(); + #endif // wxUSE_RICHTEXT diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 0921ba0ff1..263152bc9b 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -4934,6 +4934,17 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxRichTextModule, wxModule) +// If the richtext lib is dynamically loaded after the app has already started +// (such as from wxPython) then the built-in module system will not init this +// module. Provide this function to do it manually. +void wxRichTextModuleInit() +{ + wxModule* module = new wxRichTextModule; + module->Init(); + wxModule::RegisterModule(module); +} + + /*! * Commands for undo/redo *