]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/dialog.mm
supporting disabled items, closes #11130
[wxWidgets.git] / src / osx / cocoa / dialog.mm
index e5a9d3f6581691fa11e581505cc257617282ea2c..4af807536ad6a687ffe1903435d30b885ede199b 100644 (file)
@@ -45,14 +45,19 @@ void wxDialog::DoShowModal()
     }
 */
     NSWindow* theWindow = GetWXWindow();
     }
 */
     NSWindow* theWindow = GetWXWindow();
-    
+
     NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
     NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
-    while (IsModal()) 
+    while (IsModal())
     {
         wxMacAutoreleasePool autoreleasepool;
     {
         wxMacAutoreleasePool autoreleasepool;
-        if ([NSApp runModalSession:session] != NSRunContinuesResponse)
-            break;
-        // TODO should we do some idle processing ?
+        // we cannot break based on the return value, because nested
+        // alerts might set this to stopped as well, so it would be
+        // unsafe
+        [NSApp runModalSession:session];
+
+        // do some idle processing
+        if (wxTheApp)
+            wxTheApp->ProcessIdle();
     }
     [NSApp endModalSession:session];
 
     }
     [NSApp endModalSession:session];