]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/progdlgg.cpp
wxUniversal compilation fix. The fix is ok because this ash
[wxWidgets.git] / src / generic / progdlgg.cpp
index fa6c17e78886e607a0a6a435c04a2d819d7f75d6..a812cb473620d528c62e40788107d290d19bef93 100644 (file)
@@ -266,12 +266,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
         SetTimeLabel(0, m_elapsed);
     }
 
-    // Update the display (especially on X, GTK)
-    wxYield();
-
-#ifdef __WXMAC__
     Update();
-#endif
 }
 
 wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
@@ -331,7 +326,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
     {
         m_msg->SetLabel(newmsg);
 
-        wxYield();
+        wxYieldIfNeeded() ;
     }
 
     if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
@@ -370,7 +365,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
                 m_msg->SetLabel(_("Done."));
             }
 
-            wxYield();
+            wxYieldIfNeeded() ;
 
             (void)ShowModal();
         }
@@ -386,13 +381,13 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
     }
     else
     {
-        // update the display
-        wxYield();
+        // we have to yield because not only we want to update the display but
+        // also to process the clicks on the cancel button
+        wxYieldIfNeeded() ;
     }
 
-#ifdef __WXMAC__
+    // update the display in case yielding above didn't do it
     Update();
-#endif
 
     return m_state != Canceled;
 }