]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/helpers.cpp
#if around deprecated macros
[wxWidgets.git] / wxPython / src / helpers.cpp
index 57b971ae57ad73e7bd8d21bfd0b22cd2bf78d6fe..18a46a2f830af07ad3eb66cd122fe8c980a7fe9b 100644 (file)
@@ -115,9 +115,6 @@ int  wxPyApp::MainLoop() {
 
     DeletePendingObjects();
     bool initialized = wxTopLevelWindows.GetCount() != 0;
-#ifdef __WXGTK__
-    m_initialized = initialized;
-#endif
 
     if (initialized) {
         if ( m_exitOnFrameDelete == Later ) {
@@ -228,15 +225,6 @@ void wxPyApp::OnAssert(const wxChar *file,
 #endif
 
 
-/*static*/
-bool wxPyApp::GetMacDefaultEncodingIsPC() {
-#ifdef __WXMAC__
-    return s_macDefaultEncodingIsPC;
-#else
-    return 0;
-#endif
-}
-
 /*static*/
 bool wxPyApp::GetMacSupportPCMenuShortcuts() {
 #ifdef __WXMAC__
@@ -282,13 +270,6 @@ wxString wxPyApp::GetMacHelpMenuTitleName() {
 #endif
 }
 
-/*static*/
-void wxPyApp::SetMacDefaultEncodingIsPC(bool val) {
-#ifdef __WXMAC__
-    s_macDefaultEncodingIsPC = val;
-#endif
-}
-
 /*static*/
 void wxPyApp::SetMacSupportPCMenuShortcuts(bool val) {
 #ifdef __WXMAC__
@@ -381,6 +362,10 @@ void __wxPreStart(PyObject* moduleDict)
     PyEval_InitThreads();
     wxPyTStates = new wxPyThreadStateArray;
     wxPyTMutex = new wxMutex;
+
+    // Save the current (main) thread state in our array
+    PyThreadState* tstate = wxPyBeginAllowThreads();
+    wxPyEndAllowThreads(tstate);
 #endif
 
     // Ensure that the build options in the DLL (or whatever) match this build
@@ -455,10 +440,6 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
         goto error;
     }
 
-#ifdef __WXGTK__
-    wxTheApp->m_initialized = (wxTopLevelWindows.GetCount() > 0);
-#endif
-
     Py_DECREF(result);
     Py_DECREF(pyint);
     Py_INCREF(Py_None);
@@ -1689,6 +1670,10 @@ long wxPyGetWinHandle(wxWindow* win) {
     return (long)win->GetHandle();
 #endif
 
+#ifdef __WXAC__
+    return (long)win->GetHandle();
+#endif
+
     // Find and return the actual X-Window.
 #ifdef __WXGTK__
     if (win->m_wxwindow) {