X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e4a197e4c60e461b8068b0619692ea083e30b8b..d94974609888885e0b75d0e01d901b03a6213979:/wxPython/src/helpers.h diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 58c81db3a7..4cfd02d5ba 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -1288,6 +1288,27 @@ extern wxPyApp *wxPythonApp; //--------------------------------------------------------------------------- +#define DEC_PYCALLBACK_STRING__constpure(CBNAME) \ + wxString CBNAME() const; + +#define IMP_PYCALLBACK_STRING__constpure(CLASS, PCLASS, CBNAME) \ + wxString CLASS::CBNAME() const { \ + wxString rval; \ + wxPyBeginBlockThreads(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \ + if (ro) { \ + rval = Py2wxString(ro); \ + Py_DECREF(ro); \ + } \ + } \ + wxPyEndBlockThreads(); \ + return rval; \ + } + +//--------------------------------------------------------------------------- + #define DEC_PYCALLBACK_BOOL_TAG_pure(CBNAME) \ bool CBNAME(const wxHtmlTag& a); \