related to getting an Instance of wx.App
I thought I might try creating my own wrapper for getting an instance of wx.App, but wxPyConstructObject returns null
Is there something wrong with this code?
PyObject* PyApApplication::getwxApp()
{
WxPyAutoLock lock;
if (!wxPyCheckForApp(false))
throw PyNullObject();
wxApp* pApp = wxTheApp;
if (pApp == nullptr)
throw PyNullObject();
PyObject* _wxapp = wxPyConstructObject(pApp, wxT("wxApp"));// returns NULL
if (_wxapp == nullptr)
throw PyNullObject();
return _wxapp;
}
I’ve also tried other variants, wxAppBase etc.