// Author: Stefan Csomor
// Modified by:
// Created: 2008-08-30
-// RCS-ID: $Id: dirdlg.mm 40007 2006-07-05 13:10:46Z SC $
+// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif
#include "wx/filename.h"
+#include "wx/evtloop.h"
#include "wx/osx/private.h"
SetMessage( message );
SetWindowStyle(style);
SetPath(defaultPath);
+ m_sheetDelegate = [[ModalDialogDelegate alloc] init];
+ [(ModalDialogDelegate*)m_sheetDelegate setImplementation: this];
+}
+
+wxDirDialog::~wxDirDialog()
+{
+ [m_sheetDelegate release];
}
void wxDirDialog::ShowWindowModal()
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [sheetDelegate setImplementation: this];
[oPanel beginSheetForDirectory:dir.AsNSString() file:nil types: nil
- modalForWindow: nativeParent modalDelegate: sheetDelegate
+ modalForWindow: nativeParent modalDelegate: m_sheetDelegate
didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
}
int wxDirDialog::ShowModal()
{
+ wxCFEventLoopPauseIdleEvents pause;
+
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
[oPanel setCanChooseDirectories:YES];
[oPanel setResolvesAliases:YES];