Refactored Python shadows to use wxControlWithItems where appropriate.
Implememted SetClientData for wxControlWithItems. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -351,6 +351,29 @@ public:
|
||||
|
||||
|
||||
|
||||
class wxPyClientData : public wxClientData {
|
||||
public:
|
||||
wxPyClientData(PyObject* obj) {
|
||||
m_obj = obj;
|
||||
Py_INCREF(m_obj);
|
||||
}
|
||||
|
||||
~wxPyClientData() {
|
||||
#ifdef wxPyUSE_EXPORT
|
||||
wxPyTState* state = wxPyCoreAPIPtr->p_wxPyBeginBlockThreads();
|
||||
Py_DECREF(m_obj);
|
||||
wxPyCoreAPIPtr->p_wxPyEndBlockThreads(state);
|
||||
#else
|
||||
wxPyTState* state = wxPyBeginBlockThreads();
|
||||
Py_DECREF(m_obj);
|
||||
wxPyEndBlockThreads(state);
|
||||
#endif
|
||||
}
|
||||
PyObject* m_obj;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// These macros are used to implement the virtual methods that should
|
||||
// redirect to a Python method if one exists. The names designate the
|
||||
|
Reference in New Issue
Block a user