4 // SWIG File for making wish
10 * Revision 1.1 2002/04/29 19:56:57 RD
11 * Since I have made several changes to SWIG over the years to accomodate
12 * special cases and other things in wxPython, and since I plan on making
13 * several more, I've decided to put the SWIG sources in wxPython's CVS
14 * instead of relying on maintaining patches. This effectivly becomes a
15 * fork of an obsolete version of SWIG, :-( but since SWIG 1.3 still
16 * doesn't have some things I rely on in 1.1, not to mention that my
17 * custom patches would all have to be redone, I felt that this is the
18 * easier road to take.
20 * Revision 1.2 1999/11/05 21:45:14 beazley
23 * Revision 1.1.1.1 1999/02/28 02:00:56 beazley
26 * Revision 1.1 1996/05/22 19:47:45 beazley
34 This module provides the Tk_AppInit() function needed to build a
35 new version of the wish executable. Like tclsh.i, this file should
36 not be used with dynamic loading. To make an interface file work with
37 both static and dynamic loading, put something like this in your
44 A startup file may be specified by defining the symbol SWIG_RcFileName
45 as follows (this should be included in a code-block) :
47 #define SWIG_RcFileName "~/.mywishrc"
54 /* Initialization code for wish */
58 #ifndef SWIG_RcFileName
59 char *SWIG_RcFileName = "~/.wishrc";
63 extern int MacintoshInit _ANSI_ARGS_((void));
64 extern int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
68 *----------------------------------------------------------------------
72 * This procedure performs application-specific initialization.
73 * Most applications, especially those that incorporate additional
74 * packages, will have their own version of this procedure.
77 * Returns a standard Tcl completion code, and leaves an error
78 * message in interp->result if an error occurs.
81 * Depends on the startup script.
83 *----------------------------------------------------------------------
86 int Tcl_AppInit(Tcl_Interp *interp)
90 main = Tk_MainWindow(interp);
93 * Call the init procedures for included packages. Each call should
96 * if (Mod_Init(interp) == TCL_ERROR) {
100 * where "Mod" is the name of the module.
103 if (Tcl_Init(interp) == TCL_ERROR) {
107 if (Tk_Init(interp) == TCL_ERROR) {
112 * Call Tcl_CreateCommand for application-specific commands, if
113 * they weren't already created by the init procedures called above.
116 if (SWIG_init(interp) == TCL_ERROR) {
121 SetupMainInterp(interp);
125 * Specify a user-specific startup file to invoke if the application
126 * is run interactively. Typically the startup file is "~/.apprc"
127 * where "app" is the name of the application. If this line is deleted
128 * then no user-specific startup file will be run under any conditions.
131 #if TCL_MAJOR_VERSION >= 8 || TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 5
132 Tcl_SetVar(interp,"tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
134 tcl_RcFileName = SWIG_RcFileName;
137 /* For Macintosh might also want this */
140 #ifdef SWIG_RcRsrcName
141 Tcl_SetVar(interp,"tcl_rcRsrcName",SWIG_RcRsrcName,TCL_GLOBAL_ONLY);
147 #if TK_MAJOR_VERSION >= 4
148 int main(int argc, char **argv) {
152 if (MacintoshInit() != TCL_OK) {
160 Tk_Main(argc, argv, Tcl_AppInit);