summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDialog.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 4ff0f89..76bb742 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -210,7 +210,8 @@ getFileURL(
}
- (void) tkFilePanelDidEnd: (NSSavePanel *) panel
- returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
+ returnCode: (NSModalResponse) returnCode
+ contextInfo: (void *) contextInfo
{
FilePanelCallbackInfo *callbackInfo = contextInfo;
@@ -345,13 +346,14 @@ static NSInteger showOpenSavePanel(
if (parent && ![parent attachedSheet]) {
[panel beginSheetModalForWindow:parent
- completionHandler:^(NSInteger returnCode) {
+ completionHandler:^(NSModalResponse returnCode) {
[NSApp tkFilePanelDidEnd:panel
returnCode:returnCode
contextInfo:callbackInfo ];
}];
+
modalReturnCode = callbackInfo->cmdObj ? modalOther :
- [NSApp runModalForWindow:panel];
+ [panel runModal];
} else {
modalReturnCode = [panel runModal];
[NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode
@@ -654,8 +656,6 @@ Tk_GetOpenFileObjCmd(
NSInteger modalReturnCode = modalError;
BOOL parentIsKey = NO;
- [openpanel setDelegate:NSApp];
-
for (i = 1; i < objc; i += 2) {
if (Tcl_GetIndexFromObjStruct(interp, objv[i], openOptionStrings,
sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
@@ -928,8 +928,6 @@ Tk_GetSaveFileObjCmd(
NSInteger modalReturnCode = modalError;
BOOL parentIsKey = NO;
- [savepanel setDelegate:NSApp];
-
for (i = 1; i < objc; i += 2) {
if (Tcl_GetIndexFromObjStruct(interp, objv[i], saveOptionStrings,
sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
@@ -1171,8 +1169,6 @@ Tk_ChooseDirectoryObjCmd(
NSInteger modalReturnCode = modalError;
BOOL parentIsKey = NO;
- [panel setDelegate:NSApp];
-
for (i = 1; i < objc; i += 2) {
if (Tcl_GetIndexFromObjStruct(interp, objv[i], chooseOptionStrings,
sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {