]> git.saurik.com Git - wxWidgets.git/commitdiff
log messages given during program initialization are not discarded any more
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 15 Apr 1999 19:16:19 +0000 (19:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 15 Apr 1999 19:16:19 +0000 (19:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/app.cpp
src/gtk1/app.cpp

index 5c08aad9d690859e9c8bf6a3146d8ecbc8b171da..e3bb20d00d55dc2ed4241f3bf1035b3f4c692e08 100644 (file)
@@ -581,39 +581,45 @@ int wxEntry( int argc, char *argv[] )
     wxStripExtension( name );
     wxTheApp->SetAppName( name );
 
-    if (!wxTheApp->OnInitGui())
-        return 0;
+    int retValue = 0;
+
+    if ( !wxTheApp->OnInitGui() )
+        retValue = -1;
 
     // Here frames insert themselves automatically into wxTopLevelWindows by
     // getting created in OnInit().
-    if (!wxTheApp->OnInit())
-        return 0;
-
-    wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
+    if ( retValue == 0 )
+    {
+        if ( !wxTheApp->OnInit() )
+            retValue = -1;
+    }
 
-    int retValue = 0;
+    if ( retValue == 0 )
+    {
+        wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
 
-    if (wxTheApp->Initialized())
-        retValue = wxTheApp->OnRun();
+        if (wxTheApp->Initialized())
+            retValue = wxTheApp->OnRun();
 
-    wxWindow *topWindow = wxTheApp->GetTopWindow();
-    if (topWindow)
-    {
-        // Forcibly delete the window.
-        if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
-            topWindow->IsKindOf(CLASSINFO(wxDialog)) )
+        wxWindow *topWindow = wxTheApp->GetTopWindow();
+        if (topWindow)
         {
-            topWindow->Close( TRUE );
-            wxTheApp->DeletePendingObjects();
-        }
-        else
-        {
-            delete topWindow;
-            wxTheApp->SetTopWindow( (wxWindow*) NULL );
+            // Forcibly delete the window.
+            if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
+                topWindow->IsKindOf(CLASSINFO(wxDialog)) )
+            {
+                topWindow->Close( TRUE );
+                wxTheApp->DeletePendingObjects();
+            }
+            else
+            {
+                delete topWindow;
+                wxTheApp->SetTopWindow( (wxWindow*) NULL );
+            }
         }
-    }
 
-    wxTheApp->OnExit();
+        wxTheApp->OnExit();
+    }
 
     // flush the logged messages if any
     wxLog *log = wxLog::GetActiveTarget();
index 5c08aad9d690859e9c8bf6a3146d8ecbc8b171da..e3bb20d00d55dc2ed4241f3bf1035b3f4c692e08 100644 (file)
@@ -581,39 +581,45 @@ int wxEntry( int argc, char *argv[] )
     wxStripExtension( name );
     wxTheApp->SetAppName( name );
 
-    if (!wxTheApp->OnInitGui())
-        return 0;
+    int retValue = 0;
+
+    if ( !wxTheApp->OnInitGui() )
+        retValue = -1;
 
     // Here frames insert themselves automatically into wxTopLevelWindows by
     // getting created in OnInit().
-    if (!wxTheApp->OnInit())
-        return 0;
-
-    wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
+    if ( retValue == 0 )
+    {
+        if ( !wxTheApp->OnInit() )
+            retValue = -1;
+    }
 
-    int retValue = 0;
+    if ( retValue == 0 )
+    {
+        wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
 
-    if (wxTheApp->Initialized())
-        retValue = wxTheApp->OnRun();
+        if (wxTheApp->Initialized())
+            retValue = wxTheApp->OnRun();
 
-    wxWindow *topWindow = wxTheApp->GetTopWindow();
-    if (topWindow)
-    {
-        // Forcibly delete the window.
-        if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
-            topWindow->IsKindOf(CLASSINFO(wxDialog)) )
+        wxWindow *topWindow = wxTheApp->GetTopWindow();
+        if (topWindow)
         {
-            topWindow->Close( TRUE );
-            wxTheApp->DeletePendingObjects();
-        }
-        else
-        {
-            delete topWindow;
-            wxTheApp->SetTopWindow( (wxWindow*) NULL );
+            // Forcibly delete the window.
+            if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
+                topWindow->IsKindOf(CLASSINFO(wxDialog)) )
+            {
+                topWindow->Close( TRUE );
+                wxTheApp->DeletePendingObjects();
+            }
+            else
+            {
+                delete topWindow;
+                wxTheApp->SetTopWindow( (wxWindow*) NULL );
+            }
         }
-    }
 
-    wxTheApp->OnExit();
+        wxTheApp->OnExit();
+    }
 
     // flush the logged messages if any
     wxLog *log = wxLog::GetActiveTarget();