aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_impl.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2014-03-25 10:47:37 +0100
committerDan Gudmundsson <[email protected]>2014-03-25 10:47:37 +0100
commitf8a509d025fd920525ed49687465d422d71bc165 (patch)
tree8e0e4ecc2bcfb608591b5977db1b7cad20a9ef33 /lib/wx/c_src/wxe_impl.cpp
parent8bf9ec0cb4d4f15bbc2e0e6ccadb43284bcfaa7a (diff)
downloadotp-f8a509d025fd920525ed49687465d422d71bc165.tar.gz
otp-f8a509d025fd920525ed49687465d422d71bc165.tar.bz2
otp-f8a509d025fd920525ed49687465d422d71bc165.zip
wx: Fix possibility to fetch early open msgs on mac
Mac doesn't add clicked files to program arguments, a callback is invoked instead, send msgs to erlang about them.
Diffstat (limited to 'lib/wx/c_src/wxe_impl.cpp')
-rw-r--r--lib/wx/c_src/wxe_impl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index 5964ccfd00..7d5050e2d0 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -104,7 +104,7 @@ void meta_command(int what, wxe_data *sd) {
}
}
-void send_msg(const char * type, wxString * msg) {
+void send_msg(const char * type, const wxString * msg) {
wxeReturn rt = wxeReturn(WXE_DRV_PORT, init_caller);
rt.addAtom((char *) "wxe_driver");
rt.addAtom((char *) type);
@@ -160,6 +160,13 @@ bool WxeApp::OnInit()
return TRUE;
}
+
+#ifdef _MACOSX
+void WxeApp::MacOpenFile(const wxString &filename) {
+ send_msg("open_file", &filename);
+}
+#endif
+
void WxeApp::shutdown(wxeMetaCommand& Ecmd) {
ExitMainLoop();
}
@@ -491,7 +498,7 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd)
((wxBufferedDC *)ptr)->m_dc = NULL; // Workaround
}
wxString msg;
- if((refd->type == 0)) { // Maybe also class 1
+ if(refd->type == 0) { // Maybe also class 1
wxClassInfo *cinfo = ((wxObject *)ptr)->GetClassInfo();
msg.Printf(wxT("Memory leak: {wx_ref, %d, %s}"),
refd->ref, cinfo->GetClassName());