X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bfa92264c07d094c05e5a07a17fd7f5bcee8e81f..2f70baea2fa2aa1fbcdceb0121eea1cb5c9bedf0:/src/osx/cocoa/dirdlg.mm diff --git a/src/osx/cocoa/dirdlg.mm b/src/osx/cocoa/dirdlg.mm index 37e32fe813..065b554241 100644 --- a/src/osx/cocoa/dirdlg.mm +++ b/src/osx/cocoa/dirdlg.mm @@ -4,7 +4,7 @@ // 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 ///////////////////////////////////////////////////////////////////////////// @@ -45,6 +45,13 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, SetMessage( message ); SetWindowStyle(style); SetPath(defaultPath); + m_sheetDelegate = [[ModalDialogDelegate alloc] init]; + [(ModalDialogDelegate*)m_sheetDelegate setImplementation: this]; +} + +wxDirDialog::~wxDirDialog() +{ + [m_sheetDelegate release]; } void wxDirDialog::ShowWindowModal() @@ -74,10 +81,8 @@ 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]; }