diff options
author | culler <culler> | 2017-12-05 13:08:45 (GMT) |
---|---|---|
committer | culler <culler> | 2017-12-05 13:08:45 (GMT) |
commit | 2bf5f6b8191034e185f6bd6ea8cba07146900649 (patch) | |
tree | 14d7b8e083472fc34b8c4efeebcb4dbcb58ecabe | |
parent | 6520a6127ea1daf8a7c22948425467d8b8c03d38 (diff) | |
parent | 522eb2bd2a3108a178200b483e99ac7cdd4aa8b7 (diff) | |
download | tk-2bf5f6b8191034e185f6bd6ea8cba07146900649.zip tk-2bf5f6b8191034e185f6bd6ea8cba07146900649.tar.gz tk-2bf5f6b8191034e185f6bd6ea8cba07146900649.tar.bz2 |
Merge core-8-6-branch into trunk. Fixes issue with custom application icons
on MacOS.
-rw-r--r-- | macosx/tkMacOSXInit.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index d5e920a..f485d0b 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -116,7 +116,7 @@ long tkMacOSXMacOSXVersion = 0; _defaultMainMenu = nil; [self _setupMenus]; - /* + /* * Initialize event processing. */ TkMacOSXInitAppleEvents(_eventInterp); @@ -160,6 +160,23 @@ long tkMacOSXMacOSXVersion = 0; * Make sure we are allowed to open windows. */ [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + + /* + * If no icon has been set from an Info.plist file, use the Wish icon from + * the Tk framework. + */ + NSString *iconFile = [[NSBundle mainBundle] objectForInfoDictionaryKey: + @"CFBundleIconFile"]; + if (!iconFile) { + NSString *path = [NSApp tkFrameworkImagePath:@"Tk.icns"]; + if (path) { + NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; + if (image) { + [NSApp setApplicationIconImage:image]; + [image release]; + } + } + } } - (NSString *) tkFrameworkImagePath: (NSString *) image |