diff options
author | culler <culler> | 2020-10-22 19:50:59 (GMT) |
---|---|---|
committer | culler <culler> | 2020-10-22 19:50:59 (GMT) |
commit | 33ba7348673118b491542cd4ba2e50f04ef249c9 (patch) | |
tree | e95eb99b15d7004a59e09708f5ba03e2253a5ded /macosx/tkMacOSXDialog.c | |
parent | 0880b455913f559282daeb268693b8fb7a5b894c (diff) | |
download | tk-33ba7348673118b491542cd4ba2e50f04ef249c9.zip tk-33ba7348673118b491542cd4ba2e50f04ef249c9.tar.gz tk-33ba7348673118b491542cd4ba2e50f04ef249c9.tar.bz2 |
Aqua: small change to showOpenSavePanel which might prevent some API warnings.
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 42cb4a5..ba6fabd 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -346,23 +346,25 @@ static NSInteger showOpenSavePanel( NSWindow *parent, FilePanelCallbackInfo *callbackInfo) { - NSInteger modalReturnCode; + __block NSInteger modalReturnCode = modalOther; if (parent && ![parent attachedSheet]) { [panel beginSheetModalForWindow:parent - completionHandler:^(NSModalResponse returnCode) { - [NSApp tkFilePanelDidEnd:panel - returnCode:returnCode - contextInfo:callbackInfo ]; + completionHandler:^(NSModalResponse result) { + [NSApp tkFilePanelDidEnd:panel + returnCode:result + contextInfo:callbackInfo ]; + modalReturnCode = result; }]; - - modalReturnCode = callbackInfo->cmdObj ? modalOther : - [panel runModal]; } else { - modalReturnCode = [panel runModal]; - [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode - contextInfo:callbackInfo]; + [panel beginWithCompletionHandler:^(NSModalResponse result) { + [NSApp tkFilePanelDidEnd:panel + returnCode:result + contextInfo:callbackInfo ]; + modalReturnCode = result; + }]; } + [panel runModal]; return modalReturnCode; } |