]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/app.cpp
fix wxCheckListBox which was completely broken by the Unicode changes
[wxWidgets.git] / src / x11 / app.cpp
index c7b517a62daeb3acc429de1990db4b497fde966a..b42979accb583e38af149d29bafd22aad92196b3 100644 (file)
@@ -388,13 +388,10 @@ wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NUL
 
 wxApp::wxApp()
 {
-    m_topWindow = NULL;
-    wxTheApp = this;
-    m_className = "";
-    m_wantDebugOutput = TRUE ;
-    m_appName = "";
+    // TODO: parse the command line
     argc = 0;
     argv = NULL;
+
     m_mainColormap = (WXColormap) NULL;
     m_topLevelWidget = (WXWindow) NULL;
     m_maxRequestSize = 0;
@@ -571,9 +568,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
         {
             printf( "GraphicExpose event\n" );
 
-            wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str(),
-                                          event->xgraphicsexpose.x, event->xgraphicsexpose.y,
-                                          event->xgraphicsexpose.width, event->xgraphicsexpose.height);
+            wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str());
 
             win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
                                           event->xgraphicsexpose.width, event->xgraphicsexpose.height);
@@ -1179,45 +1174,52 @@ void wxExit()
 
 bool wxApp::Yield(bool onlyIfNeeded)
 {
-    bool s_inYield = FALSE;
-
-    if ( s_inYield )
+    // Sometimes only 2 yields seem
+    // to do the trick, e.g. in the
+    // progress dialog
+    int i;
+    for (i = 0; i < 2; i++)
     {
-        if ( !onlyIfNeeded )
+        bool s_inYield = FALSE;
+
+        if ( s_inYield )
         {
-            wxFAIL_MSG( wxT("wxYield called recursively" ) );
-        }
+            if ( !onlyIfNeeded )
+            {
+                wxFAIL_MSG( wxT("wxYield called recursively" ) );
+            }
 
-        return FALSE;
-    }
+            return FALSE;
+        }
 
-    s_inYield = TRUE;
+        s_inYield = TRUE;
 
-    // Make sure we have an event loop object,
-    // or Pending/Dispatch will fail
-    wxEventLoop* eventLoop = wxEventLoop::GetActive();
-    wxEventLoop* newEventLoop = NULL;
-    if (!eventLoop)
-    {
-        newEventLoop = new wxEventLoop;
-        wxEventLoop::SetActive(newEventLoop);
-    }
+        // Make sure we have an event loop object,
+        // or Pending/Dispatch will fail
+        wxEventLoop* eventLoop = wxEventLoop::GetActive();
+        wxEventLoop* newEventLoop = NULL;
+        if (!eventLoop)
+        {
+            newEventLoop = new wxEventLoop;
+            wxEventLoop::SetActive(newEventLoop);
+        }
 
-    while (wxTheApp && wxTheApp->Pending())
-        wxTheApp->Dispatch();
+        while (wxTheApp && wxTheApp->Pending())
+            wxTheApp->Dispatch();
 
 #if wxUSE_TIMER
-    wxTimer::NotifyTimers();
+        wxTimer::NotifyTimers();
 #endif
-    ProcessIdle();
+        ProcessIdle();
 
-    if (newEventLoop)
-    {
-        wxEventLoop::SetActive(NULL);
-        delete newEventLoop;
-    }
+        if (newEventLoop)
+        {
+            wxEventLoop::SetActive(NULL);
+            delete newEventLoop;
+        }
 
-    s_inYield = FALSE;
+        s_inYield = FALSE;
+    }
 
     return TRUE;
 }