diff options
author | culler <culler> | 2020-05-06 16:59:17 (GMT) |
---|---|---|
committer | culler <culler> | 2020-05-06 16:59:17 (GMT) |
commit | 50f4e918ac351ad527226b3a1939afef73c419fb (patch) | |
tree | 96b2f72694ccd93703aa4b2a4884c96a54b88085 /macosx/tkMacOSXDialog.c | |
parent | 61ab162b6375218986ca3883d6b991fa27717da6 (diff) | |
download | tk-50f4e918ac351ad527226b3a1939afef73c419fb.zip tk-50f4e918ac351ad527226b3a1939afef73c419fb.tar.gz tk-50f4e918ac351ad527226b3a1939afef73c419fb.tar.bz2 |
Avoid warnings by calling [panel runModal] instead of [NSApp runModalForWindow:panel]
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 14 |
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) { |