summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDialog.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2016-01-11 00:28:14 (GMT)
committerKevin Walzer <kw@codebykevin.com>2016-01-11 00:28:14 (GMT)
commit651d6089bd63522c1a689dabead4ed1c6c4a5f17 (patch)
tree376e182bc9c86265f4465742dc61a37a5eba44e8 /macosx/tkMacOSXDialog.c
parent1495c801841af36629d7d985074d43ddc31f62fe (diff)
downloadtk-651d6089bd63522c1a689dabead4ed1c6c4a5f17.zip
tk-651d6089bd63522c1a689dabead4ed1c6c4a5f17.tar.gz
tk-651d6089bd63522c1a689dabead4ed1c6c4a5f17.tar.bz2
Fix for 63c3542c06, messageboxes in Tk-Cocoa; thanks to Marc Culler for patch
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r--macosx/tkMacOSXDialog.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index eebff3c..4ceb010 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -1013,7 +1013,8 @@ Tk_MessageBoxObjCmd(
NSArray *buttons;
NSAlert *alert = [NSAlert new];
NSInteger modalReturnCode = 1;
-
+ BOOL parentIsKey = NO;
+
iconIndex = ICON_INFO;
typeIndex = TYPE_OK;
for (i = 1; i < objc; i += 2) {
@@ -1139,6 +1140,7 @@ Tk_MessageBoxObjCmd(
callbackInfo->typeIndex = typeIndex;
parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window);
if (haveParentOption && parent && ![parent attachedSheet]) {
+ parentIsKey = [parent isKeyWindow];
#if MAC_OS_X_VERSION_MIN_REQUIRED > 1090
[alert beginSheetModalForWindow:parent
completionHandler:^(NSModalResponse returnCode)
@@ -1161,6 +1163,9 @@ Tk_MessageBoxObjCmd(
result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR;
end:
[alert release];
+ if (parentIsKey) {
+ [parent makeKeyWindow];
+ }
return result;
}