-
- if (GetParent())
- {
- parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
- }
- else
- {
- fprintf(stderr, "No parent!\n");
- }
-
- if (parentWindow)
- {
- NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [oPanel beginSheetForDirectory:dir.AsNSString() file:nil types: nil
- modalForWindow: nativeParent modalDelegate: sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
- contextInfo: nil];
- [sheetDelegate waitForSheetToFinish];
- returnCode = [sheetDelegate code];
- [sheetDelegate release];
- }
- else
- {
- returnCode = (NSInteger)[oPanel runModalForDirectory:dir.AsNSString() file:nil types:nil];
- }
+
+ 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;
+