+ // For catching Apple Events
+void wxPyApp::MacOpenFile(const wxString &fileName)
+{
+ bool blocked = wxPyBeginBlockThreads();
+ if (wxPyCBH_findCallback(m_myInst, "MacOpenFile")) {
+ PyObject* s = wx2PyString(fileName);
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));
+ Py_DECREF(s);
+ }
+ wxPyEndBlockThreads(blocked);
+}
+
+void wxPyApp::MacPrintFile(const wxString &fileName)
+{
+ bool blocked = wxPyBeginBlockThreads();
+ if (wxPyCBH_findCallback(m_myInst, "MacPrintFile")) {
+ PyObject* s = wx2PyString(fileName);
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));
+ Py_DECREF(s);
+ }
+ wxPyEndBlockThreads(blocked);
+}
+
+void wxPyApp::MacNewFile()
+{
+ bool blocked = wxPyBeginBlockThreads();
+ if (wxPyCBH_findCallback(m_myInst, "MacNewFile"))
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));
+ wxPyEndBlockThreads(blocked);
+}
+
+void wxPyApp::MacReopenApp()
+{
+ bool blocked = wxPyBeginBlockThreads();
+ if (wxPyCBH_findCallback(m_myInst, "MacReopenApp"))
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));
+ wxPyEndBlockThreads(blocked);
+}