diff options
author | culler <culler> | 2019-10-05 20:01:50 (GMT) |
---|---|---|
committer | culler <culler> | 2019-10-05 20:01:50 (GMT) |
commit | f2f2b2bf7fa12fc84aab0a0988978f2be44cf540 (patch) | |
tree | 5912eb3cfdf2679fcdf6bd9e48c7d6e09376a589 | |
parent | b91c074724b352ba32cb41def9d3a815f7515338 (diff) | |
download | tk-f2f2b2bf7fa12fc84aab0a0988978f2be44cf540.zip tk-f2f2b2bf7fa12fc84aab0a0988978f2be44cf540.tar.gz tk-f2f2b2bf7fa12fc84aab0a0988978f2be44cf540.tar.bz2 |
Prevent multiple initializations of Mac Services, which would cause IDLE to crash.
-rw-r--r-- | macosx/Wish-Info.plist.in | 178 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 37 |
2 files changed, 103 insertions, 112 deletions
diff --git a/macosx/Wish-Info.plist.in b/macosx/Wish-Info.plist.in index d6f48e9..59a6e1a 100644 --- a/macosx/Wish-Info.plist.in +++ b/macosx/Wish-Info.plist.in @@ -8,109 +8,101 @@ this file, and for a DISCLAIMER OF ALL WARRANTIES. --> <plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleDocumentTypes</key> + <dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleDocumentTypes</key> + <array> + <dict> + <key>CFBundleTypeExtensions</key> <array> - <dict> - <key>CFBundleTypeExtensions</key> - <array> - <string>tcl</string> - <string>TCL</string> - <string>*</string> - </array> - <key>CFBundleTypeMIMETypes</key> - <array> - <string>application/x-tcl</string> - <string>text/plain</string> - </array> - <key>CFBundleTypeName</key> - <string>NSStringPboardType</string> - <key>CFBundleTypeOSTypes</key> - <array> - <string>TEXT</string> - <string>****</string> - </array> - <key>CFBundleTypeRole</key> - <string>Viewer</string> - </dict> + <string>tcl</string> + <string>TCL</string> + <string>*</string> </array> - <key>CFBundleURLTypes</key> - <array> - <dict> - <key>CFBundleTypeRole</key> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/x-tcl</string> + <string>text/plain</string> + </array> + <key>CFBundleTypeName</key> + <string>NSStringPboardType</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>TEXT</string> + <string>****</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + </dict> + </array> + <key>CFBundleURLTypes</key> + <array> + <dict> + <key>CFBundleTypeRole</key> <string>Viewer</string> <key>CFBundleURLSchemes</key> <array> - <string>foo</string> + <string>foo</string> </array> <key>CFBundleURLName</key> <string>Get Foo</string> - </dict> - </array> - <key>CFBundleExecutable</key> + </dict> + </array> + <key>CFBundleExecutable</key> + <string>Wish</string> + <key>CFBundleGetInfoString</key> + <string>Wish Shell @TK_VERSION@@TK_PATCH_LEVEL@, + Copyright © 1989-@TK_YEAR@ Tcl Core Team, + Copyright © 1989-@TK_YEAR@ Contributors, + Copyright © 2011-@TK_YEAR@ Kevin Walzer/WordTech Communications LLC, + Copyright © 2014-@TK_YEAR@ Marc Culler, + Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, + Copyright © 2001-2009 Apple Inc., + Copyright © 2001-2002 Jim Ingham & Ian Reid</string> + <key>CFBundleIconFile</key> + <string>Wish.icns</string> + <key>CFBundleIdentifier</key> + <string>com.tcltk.wish</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleLocalizations</key> + <array> + @CFBUNDLELOCALIZATIONS@ + </array> + <key>CFBundleName</key> + <string>Wish</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> + <key>CFBundleSignature</key> + <string>WiSH</string> + <key>CFBundleVersion</key> + <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> + <key>LSMinimumSystemVersion</key> + <string>10.6.0</string> + <key>LSRequiresCarbon</key> + <true/> + <key>NSAppleScriptEnabled</key> + <true/> + <key>OSAScriptingDefinition</key> + <string>Wish.sdef</string> + <key>NSHighResolutionCapable</key> + <string>True</string> + <key>NSServices</key> + <array> + <dict> + <key>NSMessage</key> + <string>provideService</string> + <key>NSPortName</key> <string>Wish</string> - <key>CFBundleGetInfoString</key> - <string>Wish Shell @TK_VERSION@@TK_PATCH_LEVEL@, - Copyright © 1989-@TK_YEAR@ Tcl Core Team, - Copyright © 1989-@TK_YEAR@ Contributors, - Copyright © 2011-@TK_YEAR@ Kevin Walzer/WordTech - Communications LLC, - Copyright © 2014-@TK_YEAR@ Marc Culler, - Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, - Copyright © 2001-2009 Apple Inc., - Copyright © 2001-2002 Jim Ingham & Ian Reid</string> - <key>CFBundleIconFile</key> - <string>Wish.icns</string> - <key>CFBundleIdentifier</key> - <string>com.tcltk.wish</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleLocalizations</key> + <key>NSSendTypes</key> <array> - @CFBUNDLELOCALIZATIONS@ + <string>NSStringPboardType</string> + <string>NSPasteboardTypeString</string> </array> - <key>CFBundleName</key> - <string>Wish</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> - <key>CFBundleSignature</key> - <string>WiSH</string> - <key>CFBundleVersion</key> - <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> - <key>LSMinimumSystemVersion</key> - <string>10.6.0</string> - <key>LSRequiresCarbon</key> - <true/> - <key>NSAppleScriptEnabled</key> - <true/> - <key>OSAScriptingDefinition</key> - <string>Wish.sdef</string> - <key>NSHighResolutionCapable</key> - <string>True</string> - <key>NSServices</key> - <array> - <dict> - <key>NSMenuItem</key> - <dict> - <key>default</key> - <string>Wish: Display Test Data</string> - </dict> - <key>NSMessage</key> - <string>provideService</string> - <key>NSPortName</key> - <string>Wish</string> - - <key>NSSendTypes</key> - <array> - <string>NSStringPboardType</string> - <string>NSPasteboardTypeString</string> - </array> - </dict> + </dict> </array> - -</dict> + </dict> </plist> diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 5b2996d..814ce54 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -396,32 +396,31 @@ TkpInit( } } - } - - if (tkLibPath[0] != '\0') { - Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY); - } + if (tkLibPath[0] != '\0') { + Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY); + } - if (scriptPath[0] != '\0') { - Tcl_SetVar2(interp, "auto_path", NULL, scriptPath, - TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE); - } + if (scriptPath[0] != '\0') { + Tcl_SetVar2(interp, "auto_path", NULL, scriptPath, + TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE); + } - Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel", + Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel", TkMacOSXStandardAboutPanelObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tk::mac::registerServiceWidget", + Tcl_CreateObjCommand(interp, "::tk::mac::registerServiceWidget", TkMacOSXRegisterServiceWidgetObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap", + Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap", TkMacOSXIconBitmapObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath, NULL, NULL); + Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath, NULL, NULL); - /* - * Initialize the NSServices object here. Apple's docs say to do this - * in applicationDidFinishLaunching, but the Tcl interpreter is not - * initialized until this function call. - */ + /* + * Initialize the NSServices object here. Apple's docs say to do this + * in applicationDidFinishLaunching, but the Tcl interpreter is not + * initialized until this function call. + */ - TkMacOSXServices_Init(interp); + TkMacOSXServices_Init(interp); + } return TCL_OK; } |