-
- wxASSERT_MSG(parentWindow, "Window modal display requires parent.");
-
- if (parentWindow)
- {
- NSWindow* nativeParent = parentWindow->GetWXWindow();
- [oPanel beginSheetForDirectory:dir.AsNSString() file:nil types: nil
- modalForWindow: nativeParent modalDelegate: m_sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
- contextInfo: nil];
- }
+
+ wxCHECK_RET(parentWindow, "Window modal display requires parent.");
+
+ m_modality = wxDIALOG_MODALITY_WINDOW_MODAL;
+
+ NSOpenPanel *oPanel = OSXCreatePanel();
+
+ NSWindow* nativeParent = parentWindow->GetWXWindow();
+ wxCFStringRef dir( m_path );
+ [oPanel beginSheetForDirectory:dir.AsNSString() file:nil types: nil
+ modalForWindow: nativeParent modalDelegate: m_sheetDelegate
+ didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo: nil];