diff options
author | culler <culler> | 2019-10-06 22:33:43 (GMT) |
---|---|---|
committer | culler <culler> | 2019-10-06 22:33:43 (GMT) |
commit | a4481b896fcc3475113e8c7130af97f0fd91949d (patch) | |
tree | 03ae9ece41f320352b3bd84489eb3509a48f7e0a /macosx/tkMacOSXInit.c | |
parent | f2f2b2bf7fa12fc84aab0a0988978f2be44cf540 (diff) | |
download | tk-a4481b896fcc3475113e8c7130af97f0fd91949d.zip tk-a4481b896fcc3475113e8c7130af97f0fd91949d.tar.gz tk-a4481b896fcc3475113e8c7130af97f0fd91949d.tar.bz2 |
Some initialization steps can remain outside the if (!initialized) block.
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r-- | macosx/tkMacOSXInit.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 814ce54..3d06691 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -396,32 +396,34 @@ TkpInit( } } - 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); - } - - Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel", - TkMacOSXStandardAboutPanelObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tk::mac::registerServiceWidget", - TkMacOSXRegisterServiceWidgetObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap", - TkMacOSXIconBitmapObjCmd, 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. + * initialized until this function call. Only the main interpreter + * is allowed to provide services. */ + Tcl_CreateObjCommand(interp, "::tk::mac::registerServiceWidget", + TkMacOSXRegisterServiceWidgetObjCmd, NULL, NULL); TkMacOSXServices_Init(interp); } + 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); + } + + Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel", + TkMacOSXStandardAboutPanelObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap", + TkMacOSXIconBitmapObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath, NULL, NULL); + return TCL_OK; } |