X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1893b029458c15069855bde50889d2a1a82a44e9..8c68e84d42f1e315c415ad677c26b185efee637b:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index c8cf22a045..6a196331a3 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -441,30 +441,14 @@ PyObject* wxPyConstructObject(void* ptr, //--------------------------------------------------------------------------- -// TODO: This should really be wxThread::GetCurrentId(), and I will do so -// after I make a quick 2.3.2.1 release. + #ifdef WXP_WITH_THREAD -#ifdef __WXGTK__ // does wxGTK always use pthreads? -#include -#include -#endif inline unsigned long wxPyGetCurrentThreadId() { -#ifdef __WXMSW__ - return (unsigned long)::GetCurrentThreadId(); -#endif -#ifdef __WXGTK__ // does wxGTK always use pthreads? - return (unsigned long)pthread_self(); -#endif -#ifdef __WXMAC__ - ThreadID current ; - MacGetCurrentThread( ¤t ) ; - return (unsigned long)current; -#endif + return wxThread::GetCurrentId(); } - static PyThreadState* wxPyGetThreadState() { unsigned long ctid = wxPyGetCurrentThreadId(); @@ -1506,6 +1490,18 @@ PyObject* wxArrayString2PyList_helper(const wxArrayString& arr) { } +PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr) { + + PyObject* list = PyList_New(0); + for (size_t i=0; i < arr.GetCount(); i++) { + PyObject* number = PyInt_FromLong(arr[i]); + PyList_Append(list, number); + Py_DECREF(number); + } + return list; +} + + //---------------------------------------------------------------------- //----------------------------------------------------------------------