diff options
author | Dan Gudmundsson <[email protected]> | 2015-06-30 12:53:02 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2015-06-30 12:53:02 +0200 |
commit | 4246d988b53947c7a7f0ce4943a83af38d129435 (patch) | |
tree | f6e2859c8e9d0e55e5ae76f7c460cca2c0c1972a /lib/wx/c_src | |
parent | 46285b9f6f9cbe102e22aaf6157e436797404f00 (diff) | |
download | otp-4246d988b53947c7a7f0ce4943a83af38d129435.tar.gz otp-4246d988b53947c7a7f0ce4943a83af38d129435.tar.bz2 otp-4246d988b53947c7a7f0ce4943a83af38d129435.zip |
wx: Send wxWdigets assert to error logger
Instead of popping up an annoying msgbox
Diffstat (limited to 'lib/wx/c_src')
-rw-r--r-- | lib/wx/c_src/wxe_impl.cpp | 19 | ||||
-rw-r--r-- | lib/wx/c_src/wxe_impl.h | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 6236fb708e..e6ed236962 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -181,6 +181,25 @@ void WxeApp::dummy_close(wxEvent& Ev) { // windows open, and this will kill the erlang, override default handling } +void WxeApp::OnAssertFailure(const wxChar *file, int line, const wxChar *cfunc, + const wxChar *cond, const wxChar *cmsgUser) { + wxString msg; + wxString func(cfunc); + wxString msgUser(cmsgUser); + + msg.Printf(wxT("wxWidgets Assert failure: %s(%d): \"%s\""), + file, line, cond); + if ( !func.empty() ) { + msg << wxT(" in ") << func << wxT("()"); + } + // and the message itself + if ( !msgUser.empty() ) { + msg << wxT(" : ") << msgUser; + } + + send_msg("error", &msg); +} + // Called by wx thread void WxeApp::idle(wxIdleEvent& event) { event.Skip(true); diff --git a/lib/wx/c_src/wxe_impl.h b/lib/wx/c_src/wxe_impl.h index d8241d11a4..d6d3095a0f 100644 --- a/lib/wx/c_src/wxe_impl.h +++ b/lib/wx/c_src/wxe_impl.h @@ -57,9 +57,14 @@ class WxeApp : public wxApp { public: virtual bool OnInit(); + + virtual void OnAssertFailure(const wxChar *file, int line, const wxChar *func, + const wxChar *cond, const wxChar *msg); + #ifdef _MACOSX virtual void MacOpenFile(const wxString &filename); #endif + void shutdown(wxeMetaCommand& event); int dispatch(wxeFifo *, int, int); |