+ return oPanel;
+}
+
+void wxDirDialog::ShowWindowModal()
+{
+ wxNonOwnedWindow* parentWindow = NULL;
+
+ if (GetParent())
+ parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
+
+ 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];
+}
+
+int wxDirDialog::ShowModal()
+{
+ WX_HOOK_MODAL_DIALOG();
+
+ wxCFEventLoopPauseIdleEvents pause;
+
+ NSOpenPanel *oPanel = OSXCreatePanel();
+