]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/msgdlg.mm
conforming to new naming convention of starting all port specific methods with the...
[wxWidgets.git] / src / osx / cocoa / msgdlg.mm
index 255576afd133f258529c75aa178252b19ff9300c..ab6ffb99e6981151ebdf5e0867c4a7f2a424fcaf 100644 (file)
@@ -183,8 +183,32 @@ int wxMessageDialog::ShowModal()
             }
         }
 
-        int button = [alert runModal];
-        
+
+        wxNonOwnedWindow* parentWindow = NULL;
+        int button = -1;
+                
+        if (GetParent()) 
+        {
+            parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
+        }
+ /*
+        if (parentWindow)
+        {
+            NSWindow* nativeParent = parentWindow->GetWXWindow();
+            ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init]; 
+            [alert beginSheetModalForWindow: nativeParent modalDelegate: sheetDelegate 
+                didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) 
+                contextInfo: nil];
+            [sheetDelegate waitForSheetToFinish];
+            button = [sheetDelegate code];
+            [sheetDelegate release];
+        }
+        else
+*/
+        {
+            button = [alert runModal];
+        }
         [alert release];
         
         if ( button < NSAlertFirstButtonReturn )