X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/401eb3dec29c09b9afcc843842cba48b33a5089b..a696db453c79ff58509195244bcf260dfdf13c81:/src/common/msgout.cpp diff --git a/src/common/msgout.cpp b/src/common/msgout.cpp index 7addcc6310..1ac9f944f8 100755 --- a/src/common/msgout.cpp +++ b/src/common/msgout.cpp @@ -38,6 +38,7 @@ #endif #include "wx/msgout.h" +#include "wx/log.h" #include #include @@ -50,16 +51,11 @@ wxMessageOutput* wxMessageOutput::ms_msgOut = 0; wxMessageOutput* wxMessageOutput::Get() { - // FIXME this is an hack - static bool inGet = FALSE; - - if(!ms_msgOut && wxTheApp && !inGet) + if ( !ms_msgOut && wxTheApp ) { - inGet = TRUE; - wxTheApp->DoInit(); + ms_msgOut = wxTheApp->CreateMessageOutput(); } - inGet = FALSE; return ms_msgOut; } @@ -115,15 +111,15 @@ void wxMessageOutputMessageBox::Printf(const wxChar* format, ...) void wxMessageOutputLog::Printf(const wxChar* format, ...) { + wxString out; + va_list args; va_start(args, format); - wxString out; out.PrintfV(format, args); va_end(args); - out.Replace("\t"," "); - // under Motif, wxMessageDialog needs a parent window, so we use - // wxLog, which is better than nothing - ::wxLogMessage("%s", out.c_str()); + out.Replace(wxT("\t"),wxT(" ")); + + ::wxLogMessage(wxT("%s"), out.c_str()); }