]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/helpers.cpp
Check for existing colour names when adding to wxTheColourDatabase
[wxWidgets.git] / wxPython / src / helpers.cpp
index c8cf22a0454fd8425c44b2dd853eb0b20fd839ab..13f93b78c388f8dcc879cfa56910b0f37790743c 100644 (file)
@@ -223,11 +223,13 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
 
 void __wxCleanup() {
     wxEntryCleanup();
 
 void __wxCleanup() {
     wxEntryCleanup();
+#ifdef WXP_WITH_THREAD
     delete wxPyTMutex;
     wxPyTMutex = NULL;
     wxPyTStates->Empty();
     delete wxPyTStates;
     wxPyTStates = NULL;
     delete wxPyTMutex;
     wxPyTMutex = NULL;
     wxPyTStates->Empty();
     delete wxPyTStates;
     wxPyTStates = NULL;
+#endif
 }
 
 
 }
 
 
@@ -441,30 +443,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 WXP_WITH_THREAD
-#ifdef __WXGTK__  // does wxGTK always use pthreads?
-#include <unistd.h>
-#include <pthread.h>
-#endif
 inline
 unsigned long wxPyGetCurrentThreadId() {
 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( &current ) ;
-    return (unsigned long)current;
-#endif
+    return wxThread::GetCurrentId();
 }
 
 
 }
 
 
-
 static
 PyThreadState* wxPyGetThreadState() {
     unsigned long ctid = wxPyGetCurrentThreadId();
 static
 PyThreadState* wxPyGetThreadState() {
     unsigned long ctid = wxPyGetCurrentThreadId();
@@ -1506,6 +1492,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;
+}
+
+
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
 
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------