]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
MSWOnCommand bug fixed
[wxWidgets.git] / src / msw / utils.cpp
index 1433988261e79ea1db38e26419a8c8f3a0f57e29..3dc34fdc7e5556f4549575c754c3b6d2dbc6817b 100644 (file)
@@ -301,7 +301,23 @@ static wxTimer *wxTheSleepTimer = NULL;
 
 void wxUsleep(unsigned long milliseconds)
 {
+#ifdef __WIN32__
     ::Sleep(milliseconds);
+#else
+  if (inTimer)
+    return;
+
+  wxTheSleepTimer = new wxSleepTimer;
+  inTimer = TRUE;
+  wxTheSleepTimer->Start(milliseconds);
+  while (inTimer)
+  {
+    if (wxTheApp->Pending())
+      wxTheApp->Dispatch();
+  }
+  delete wxTheSleepTimer;
+  wxTheSleepTimer = NULL;
+#endif
 }
 
 void wxSleep(int nSecs)