+}
+
+int wxDirDialog::ShowModal()
+{
+ NSOpenPanel *oPanel = [NSOpenPanel openPanel];
+ [oPanel setCanChooseDirectories:YES];
+ [oPanel setResolvesAliases:YES];
+ [oPanel setCanChooseFiles:NO];
+
+ wxCFStringRef cf( m_message );
+ [oPanel setMessage:cf.AsNSString()];
+
+ if ( HasFlag(wxDD_NEW_DIR_BUTTON) )
+ [oPanel setCanCreateDirectories:YES];
+
+ wxCFStringRef dir( m_path );
+
+ m_path = wxEmptyString;
+
+ int returnCode = -1;
+
+ returnCode = (NSInteger)[oPanel runModalForDirectory:dir.AsNSString() file:nil types:nil];
+ ModalFinishedCallback(oPanel, returnCode);
+
+ return GetReturnCode();
+}
+
+void wxDirDialog::ModalFinishedCallback(void* panel, int returnCode)
+{
+ int result = wxID_CANCEL;
+