Added Python wrappers for wxRTTI for the wxVScrolledWindow,
wxVListBox, and wxHtmlListBox classes. Removed the calls to wxClassInfo::Cleanup and Initialize. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,7 +42,7 @@ public:
|
||||
virtual ~MyApp();
|
||||
void Init_wxPython();
|
||||
private:
|
||||
PyThreadState* main_tstate;
|
||||
PyThreadState* m_mainTState;
|
||||
};
|
||||
|
||||
|
||||
@@ -83,16 +83,22 @@ void MyApp::Init_wxPython()
|
||||
// module and sets a pointer to a function table located there.
|
||||
wxPyCoreAPI_IMPORT();
|
||||
|
||||
// Ensure that the new classes defined in the wxPython wrappers are
|
||||
// recognised by the wx RTTI system. (If you don't use wxWindow in
|
||||
// your C++ app you won't need to do this.)
|
||||
wxClassInfo::CleanUpClasses();
|
||||
wxClassInfo::InitializeClasses();
|
||||
|
||||
// Save the current Python thread state and release the
|
||||
// Global Interpreter Lock.
|
||||
main_tstate = wxPyBeginAllowThreads();
|
||||
m_mainTState = wxPyBeginAllowThreads();
|
||||
}
|
||||
|
||||
|
||||
MyApp::~MyApp()
|
||||
{
|
||||
// Restore the thread state and tell Python to cleanup after itself.
|
||||
wxPyEndAllowThreads(main_tstate);
|
||||
wxPyEndAllowThreads(m_mainTState);
|
||||
Py_Finalize();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user