summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDialog.c
diff options
context:
space:
mode:
authorculler <culler>2020-10-22 19:50:59 (GMT)
committerculler <culler>2020-10-22 19:50:59 (GMT)
commit33ba7348673118b491542cd4ba2e50f04ef249c9 (patch)
treee95eb99b15d7004a59e09708f5ba03e2253a5ded /macosx/tkMacOSXDialog.c
parent0880b455913f559282daeb268693b8fb7a5b894c (diff)
downloadtk-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.c24
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;
}