summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authorculler <culler>2017-11-25 23:43:20 (GMT)
committerculler <culler>2017-11-25 23:43:20 (GMT)
commit81efb6d53e7bf033eb85ba3be24d3dc14e0cc28c (patch)
tree9f9a96de7fe14e1f8bd704bc96385672bdd433ee /macosx/tkMacOSXInit.c
parent29e17ea17e7aa8143a004f6465a432b02bfdb8a9 (diff)
downloadtk-81efb6d53e7bf033eb85ba3be24d3dc14e0cc28c.zip
tk-81efb6d53e7bf033eb85ba3be24d3dc14e0cc28c.tar.gz
tk-81efb6d53e7bf033eb85ba3be24d3dc14e0cc28c.tar.bz2
Repair a mistake introduced in checkin [fc16f8a9]. In TkpInit the NSApplication
must be created before opening a console. Otherwise apps launched from an icon will crash.
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 6eba796..7b91f97 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -316,6 +316,24 @@ TkpInit(
}
/*
+ * Instantiate our NSApplication object. This needs to be
+ * done before we check whether to open a console window.
+ */
+
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
+ [[NSUserDefaults standardUserDefaults] registerDefaults:
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES],
+ @"_NSCanWrapButtonTitles",
+ [NSNumber numberWithInt:-1],
+ @"NSStringDrawingTypesetterBehavior",
+ nil]];
+ [TKApplication sharedApplication];
+ [pool drain];
+ [NSApp _setup:interp];
+ [NSApp finishLaunching];
+
+ /*
* If we don't have a TTY and stdin is a special character file of
* length 0, (e.g. /dev/null, which is what Finder sets when double
* clicking Wish) then use the Tk based console interpreter.
@@ -348,22 +366,6 @@ TkpInit(
}
}
- /*
- * Instantiate our NSApplication object.
- */
-
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
- [[NSUserDefaults standardUserDefaults] registerDefaults:
- [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:YES],
- @"_NSCanWrapButtonTitles",
- [NSNumber numberWithInt:-1],
- @"NSStringDrawingTypesetterBehavior",
- nil]];
- [TKApplication sharedApplication];
- [pool drain];
- [NSApp _setup:interp];
- [NSApp finishLaunching];
}
Tk_MacOSXSetupTkNotifier();