From: Robin Dunn Date: Thu, 12 Apr 2007 00:44:02 +0000 (+0000) Subject: wxMac: The get-url apple event is now supported, simply override X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/91d6301a7b34ba2f4b6675ae5b6e6b3fee178079 wxMac: The get-url apple event is now supported, simply override wx.App.MacOpenURL to receive it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index c38e2f3648..3e7a8e9c9c 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -297,6 +297,17 @@ void wxPyApp::MacOpenFile(const wxString &fileName) wxPyEndBlockThreads(blocked); } +void wxPyApp::MacOpenURL(const wxString &url) +{ + wxPyBlock_t blocked = wxPyBeginBlockThreads(); + if (wxPyCBH_findCallback(m_myInst, "MacOpenURL")) { + PyObject* s = wx2PyString(url); + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s)); + Py_DECREF(s); + } + wxPyEndBlockThreads(blocked); +} + void wxPyApp::MacPrintFile(const wxString &fileName) { wxPyBlock_t blocked = wxPyBeginBlockThreads(); @@ -2524,6 +2535,17 @@ bool wxPoint_helper(PyObject* source, wxPoint** obj) +bool wxPosition_helper(PyObject* source, wxPosition** obj) +{ + if (source == Py_None) { + **obj = wxPosition(-1,-1); + return true; + } + return wxPyTwoIntItem_helper(source, obj, wxT("wxPosition")); +} + + + bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj) { if (source == Py_None) {