Redo (again) how the stock objects are initialized in wxPython.
Factor out the wxPyTwoIntItem_helper template function so it can be used in other extension modules. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "wx/wxPython/wxPython_int.h"
|
||||
#include "wx/wxPython/pyistream.h"
|
||||
#include "wx/wxPython/swigver.h"
|
||||
#include "wx/wxPython/twoitem.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include <wx/msw/private.h>
|
||||
@@ -469,8 +470,19 @@ void wxPyApp::_BootstrapApp()
|
||||
// It's now ok to generate exceptions for assertion errors.
|
||||
wxPythonApp->SetStartupComplete(true);
|
||||
|
||||
// Call the Python wxApp's OnInit function
|
||||
|
||||
// Call the Python wxApp's OnPreInit and OnInit functions
|
||||
blocked = wxPyBeginBlockThreads();
|
||||
if (wxPyCBH_findCallback(m_myInst, "OnPreInit")) {
|
||||
PyObject* method = m_myInst.GetLastFound();
|
||||
PyObject* argTuple = PyTuple_New(0);
|
||||
retval = PyEval_CallObject(method, argTuple);
|
||||
m_myInst.clearRecursionGuard(method);
|
||||
Py_DECREF(argTuple);
|
||||
Py_DECREF(method);
|
||||
if (retval == NULL)
|
||||
goto error;
|
||||
}
|
||||
if (wxPyCBH_findCallback(m_myInst, "OnInit")) {
|
||||
|
||||
PyObject* method = m_myInst.GetLastFound();
|
||||
|
Reference in New Issue
Block a user