1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * SWIG File for making wish
8 * ----------------------------------------------------------------------------- */
13 This module provides the Tk_AppInit() function needed to build a
14 new version of the wish executable. Like tclsh.i, this file should
15 not be used with dynamic loading. To make an interface file work with
16 both static and dynamic loading, put something like this in your
23 A startup file may be specified by defining the symbol SWIG_RcFileName
24 as follows (this should be included in a code-block) :
26 #define SWIG_RcFileName "~/.mywishrc"
33 /* Initialization code for wish */
37 #ifndef SWIG_RcFileName
38 char *SWIG_RcFileName = "~/.wishrc";
42 extern int MacintoshInit _ANSI_ARGS_((void));
43 extern int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
47 *----------------------------------------------------------------------
51 * This procedure performs application-specific initialization.
52 * Most applications, especially those that incorporate additional
53 * packages, will have their own version of this procedure.
56 * Returns a standard Tcl completion code, and leaves an error
57 * message in interp->result if an error occurs.
60 * Depends on the startup script.
62 *----------------------------------------------------------------------
65 int Tcl_AppInit(Tcl_Interp *interp)
69 main = Tk_MainWindow(interp);
72 * Call the init procedures for included packages. Each call should
75 * if (Mod_Init(interp) == TCL_ERROR) {
79 * where "Mod" is the name of the module.
82 if (Tcl_Init(interp) == TCL_ERROR) {
86 if (Tk_Init(interp) == TCL_ERROR) {
91 * Call Tcl_CreateCommand for application-specific commands, if
92 * they weren't already created by the init procedures called above.
95 if (SWIG_init(interp) == TCL_ERROR) {
100 SetupMainInterp(interp);
104 * Specify a user-specific startup file to invoke if the application
105 * is run interactively. Typically the startup file is "~/.apprc"
106 * where "app" is the name of the application. If this line is deleted
107 * then no user-specific startup file will be run under any conditions.
110 #if TCL_MAJOR_VERSION >= 8 || TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 5
111 Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
113 tcl_RcFileName = SWIG_RcFileName;
116 /* For Macintosh might also want this */
119 #ifdef SWIG_RcRsrcName
120 Tcl_SetVar(interp, (char *) "tcl_rcRsrcName",SWIG_RcRsrcName,TCL_GLOBAL_ONLY);
126 #if TK_MAJOR_VERSION >= 4
127 int main(int argc, char **argv) {
131 if (MacintoshInit() != TCL_OK) {
139 Tk_Main(argc, argv, Tcl_AppInit);