X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e06b283ceba99daab0c8a8752cc7bbd77225eb1..aa6208d975c3757d75d780c661b4d7918236f4fb:/src/osx/cocoa/msgdlg.mm diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index 255576afd1..ab6ffb99e6 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -183,8 +183,32 @@ int wxMessageDialog::ShowModal() } } - int button = [alert runModal]; - + + wxNonOwnedWindow* parentWindow = NULL; + int button = -1; + + if (GetParent()) + { + parentWindow = dynamic_cast(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 )