X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72fa862b0430bf0f4babeb392555e79e02fc8378..758bce950ba9236d0a9edc4c880c3ec73b5173f3:/src/mgl/app.cpp diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index c5535f75c8..d9ff129be0 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -18,12 +18,14 @@ #pragma hdrstop #endif + #ifndef WX_PRECOMP #include "wx/settings.h" #include "wx/module.h" #include "wx/evtloop.h" #include "wx/frame.h" #include "wx/dialog.h" + #include "wx/log.h" #include "wx/intl.h" #endif @@ -31,6 +33,12 @@ #include "wx/fontutil.h" #include "wx/mgl/private.h" +#define MGL_DEBUG + +#if defined(MGL_DEBUG) && !defined(__WXDEBUG__) +#undef MGL_DEBUG +#endif + //----------------------------------------------------------------------------- // Global data //----------------------------------------------------------------------------- @@ -136,8 +144,6 @@ wxApp::~wxApp() bool wxApp::OnInitGui() { - if ( MGL_init(".", NULL) == 0 ) - return FALSE; if ( !wxCreateMGL_WM() ) return FALSE; @@ -146,6 +152,12 @@ bool wxApp::OnInitGui() if ( !wxAppBase::OnInitGui() ) return FALSE; +#ifdef MGL_DEBUG + // That damn MGL redirects stdin and stdout to physical console + FILE *file = fopen("stderr", "wt"); + wxLog::SetActiveTarget(new wxLogStderr(file)); +#endif + return TRUE; } @@ -242,9 +254,7 @@ void wxApp::ExitMainLoop() bool wxApp::Initialized() { - // FIXME_MGL -- only for now because we don't have wxFrame/wxDialog yet - return TRUE; - //return (wxTopLevelWindows.GetCount() != 0); + return (wxTopLevelWindows.GetCount() != 0); } bool wxApp::Pending() @@ -275,6 +285,9 @@ void wxApp::DeletePendingObjects() bool wxApp::Initialize() { + if ( MGL_init(".", NULL) == 0 ) + return FALSE; + wxBuffer = new wxChar[BUFSIZ + 512]; wxClassInfo::InitializeClasses();