int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
int retval = 0;
PyObject* func = (PyObject*)funcPtr;
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
PyObject* args = Py_BuildValue("(ii)", item1, item2);
PyObject* result = PyEval_CallObject(func, args);
Py_DECREF(result);
}
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
return retval;
}
}
~wxPyTreeItemData() {
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
Py_DECREF(m_obj);
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
}
PyObject* GetData() {
}
void SetData(PyObject* obj) {
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
Py_DECREF(m_obj);
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
m_obj = obj;
Py_INCREF(obj);
}
int OnCompareItems(const wxTreeItemId& item1,
const wxTreeItemId& item2) {
int rval = 0;
- bool doSave = wxPyRestoreThread();
- if (m_myInst.findCallback("OnCompareItems"))
+ bool found;
+ wxPyTState* state = wxPyBeginBlockThreads();
+ if ((found = m_myInst.findCallback("OnCompareItems")))
rval = m_myInst.callCallback(Py_BuildValue(
"(OO)",
wxPyConstructObject((void*)&item1, "wxTreeItemId"),
wxPyConstructObject((void*)&item2, "wxTreeItemId")));
- else
+ wxPyEndBlockThreads(state);
+ if (! found)
rval = wxTreeCtrl::OnCompareItems(item1, item2);
- wxPySaveThread(doSave);
return rval;
}
PYPRIVATE;
return _resultobj;
}
+#define wxTreeEvent_GetKeyEvent(_swigobj) (_swigobj->GetKeyEvent())
+static PyObject *_wrap_wxTreeEvent_GetKeyEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxKeyEvent * _result;
+ wxTreeEvent * _arg0;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self", NULL };
+ char _ptemp[128];
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTreeEvent_GetKeyEvent",_kwnames,&_argo0))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeEvent_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeEvent_GetKeyEvent. Expected _wxTreeEvent_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ const wxKeyEvent & _result_ref = wxTreeEvent_GetKeyEvent(_arg0);
+ _result = (wxKeyEvent *) &_result_ref;
+
+ wxPy_END_ALLOW_THREADS;
+ if (PyErr_Occurred()) return NULL;
+} if (_result) {
+ SWIG_MakePtr(_ptemp, (char *) _result,"_wxKeyEvent_p");
+ _resultobj = Py_BuildValue("s",_ptemp);
+ } else {
+ Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ }
+ return _resultobj;
+}
+
#define wxTreeEvent_GetCode(_swigobj) (_swigobj->GetCode())
static PyObject *_wrap_wxTreeEvent_GetCode(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
}
static PyObject * wxPyTreeCtrl_GetSelections(wxPyTreeCtrl *self) {
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
PyObject* rval = PyList_New(0);
wxArrayTreeItemIds array;
size_t num, x;
PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
PyList_Append(rval, item);
}
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
return rval;
}
static PyObject *_wrap_wxTreeCtrl_GetSelections(PyObject *self, PyObject *args, PyObject *kwargs) {
static PyObject * wxPyTreeCtrl_GetBoundingRect(wxPyTreeCtrl *self,const wxTreeItemId & item,int textOnly) {
wxRect rect;
if (self->GetBoundingRect(item, rect, textOnly)) {
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
wxRect* r = new wxRect(rect);
PyObject* val = wxPyConstructObject((void*)r, "wxRect");
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
return val;
}
else {
{ "new_wxTreeCtrl", (PyCFunction) _wrap_new_wxTreeCtrl, METH_VARARGS | METH_KEYWORDS },
{ "wxTreeEvent_GetLabel", (PyCFunction) _wrap_wxTreeEvent_GetLabel, METH_VARARGS | METH_KEYWORDS },
{ "wxTreeEvent_GetCode", (PyCFunction) _wrap_wxTreeEvent_GetCode, METH_VARARGS | METH_KEYWORDS },
+ { "wxTreeEvent_GetKeyEvent", (PyCFunction) _wrap_wxTreeEvent_GetKeyEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxTreeEvent_GetPoint", (PyCFunction) _wrap_wxTreeEvent_GetPoint, METH_VARARGS | METH_KEYWORDS },
{ "wxTreeEvent_GetOldItem", (PyCFunction) _wrap_wxTreeEvent_GetOldItem, METH_VARARGS | METH_KEYWORDS },
{ "wxTreeEvent_GetItem", (PyCFunction) _wrap_wxTreeEvent_GetItem, METH_VARARGS | METH_KEYWORDS },