| 183 | * |
| 184 | *---------------------------------------------------------------------- |
| 185 | */ |
| 186 | |
| 187 | int |
| 188 | Tcl_AppInit(Tcl_Interp *interp) |
| 189 | { |
| 190 | if (Tcl_Init(interp) == TCL_ERROR) { |
| 191 | goto error; |
| 192 | } |
| 193 | if (Tk_Init(interp) == TCL_ERROR) { |
| 194 | goto error; |
| 195 | } |
| 196 | Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); |
| 197 | |
| 198 | /* |
| 199 | * Initialize the console only if we are running as an interactive |
| 200 | * application. |
| 201 | */ |
| 202 | |
| 203 | if (consoleRequired) { |
| 204 | if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) { |
| 205 | goto error; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | #ifdef TCL_TEST |
| 210 | if (Tcltest_Init(interp) == TCL_ERROR) { |
| 211 | return TCL_ERROR; |
| 212 | } |
| 213 | Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init, |
| 214 | (Tcl_PackageInitProc *) NULL); |
| 215 | if (TclObjTest_Init(interp) == TCL_ERROR) { |
| 216 | return TCL_ERROR; |
| 217 | } |
| 218 | #endif /* TCL_TEST */ |
| 219 | |
| 220 | #ifdef TK_TEST |
| 221 | if (Tktest_Init(interp) == TCL_ERROR) { |
| 222 | goto error; |
| 223 | } |
| 224 | Tcl_StaticPackage(interp, "Tktest", Tktest_Init, |
| 225 | (Tcl_PackageInitProc *) NULL); |
| 226 | #endif /* TK_TEST */ |
| 227 | |
| 228 | |
| 229 | if (OpenSeesAppInit(interp) < 0) |
| 230 | return TCL_ERROR; |
| 231 | |
| 232 | |
| 233 | Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY); |
| 234 | return TCL_OK; |
| 235 | |
| 236 | error: |
| 237 | MessageBeep(MB_ICONEXCLAMATION); |
| 238 | MessageBox(NULL, Tcl_GetStringResult(interp), "Error in Wish", |
| 239 | MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND); |
| 240 | ExitProcess(1); |
| 241 | /* we won't reach this, but we need the return */ |
| 242 | return TCL_ERROR; |
nothing calls this directly
no test coverage detected