]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/dirdlg.mm
Fit modeless preferences dialog to its contents too.
[wxWidgets.git] / src / osx / cocoa / dirdlg.mm
index 59f77683c79593a1439607ce76ded497228cfa16..02f92f94f834021452b8ae1fef664c9c9fce5ede 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "wx/filename.h"
 #include "wx/evtloop.h"
+#include "wx/modalhook.h"
 
 #include "wx/osx/private.h"
 
@@ -94,6 +95,8 @@ void wxDirDialog::ShowWindowModal()
 
 int wxDirDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
     wxCFEventLoopPauseIdleEvents pause;
 
     NSOpenPanel *oPanel = OSXCreatePanel();
@@ -117,7 +120,7 @@ void wxDirDialog::ModalFinishedCallback(void* panel, int returnCode)
     if (returnCode == NSOKButton )
     {
         NSOpenPanel* oPanel = (NSOpenPanel*)panel;
-        SetPath( wxCFStringRef::AsString([[oPanel filenames] objectAtIndex:0]));
+        SetPath( wxCFStringRef::AsStringWithNormalizationFormC([[oPanel filenames] objectAtIndex:0]));
         result = wxID_OK;
     }
     SetReturnCode(result);