// $Header: /cvsroot/swig/SWIG/Lib/tcl/wish.i,v 1.3 2002/11/30 22:10:09 beazley Exp $
// SWIG File for making wish
* Revision 1.3 2002/11/30 22:10:09 beazley
* *** empty log message ***
* Revision 1.1.2.1 2001/06/20 11:47:29 mkoeppe
* Revision 1.1 2000/01/11 21:15:54 beazley
* Revision 1.2 1999/11/05 21:45:14 beazley
* Revision 1.1.1.1 1999/02/28 02:00:56 beazley
* Revision 1.1 1996/05/22 19:47:45 beazley
This module provides the Tk_AppInit() function needed to build a
new version of the wish executable. Like tclsh.i, this file should
not be used with dynamic loading. To make an interface file work with
both static and dynamic loading, put something like this in your
A startup file may be specified by defining the symbol SWIG_RcFileName
as follows (this should be included in a code-block) :
#define SWIG_RcFileName "~/.mywishrc"
/* Initialization code for wish */
char *SWIG_RcFileName = "~/.wishrc";
extern int MacintoshInit _ANSI_ARGS_((void));
extern int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
*----------------------------------------------------------------------
* This procedure performs application-specific initialization.
* Most applications, especially those that incorporate additional
* packages, will have their own version of this procedure.
* Returns a standard Tcl completion code, and leaves an error
* message in interp->result if an error occurs.
* Depends on the startup script.
*----------------------------------------------------------------------
int Tcl_AppInit(Tcl_Interp *interp)
main = Tk_MainWindow(interp);
* Call the init procedures for included packages. Each call should
* if (Mod_Init(interp) == TCL_ERROR) {
* where "Mod" is the name of the module.
if (Tcl_Init(interp) == TCL_ERROR) {
if (Tk_Init(interp) == TCL_ERROR) {
* Call Tcl_CreateCommand for application-specific commands, if
* they weren't already created by the init procedures called above.
if (SWIG_init(interp) == TCL_ERROR) {
* Specify a user-specific startup file to invoke if the application
* is run interactively. Typically the startup file is "~/.apprc"
* where "app" is the name of the application. If this line is deleted
* then no user-specific startup file will be run under any conditions.
#if TCL_MAJOR_VERSION >= 8 || TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 5
Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
tcl_RcFileName = SWIG_RcFileName;
/* For Macintosh might also want this */
Tcl_SetVar(interp, (char *) "tcl_rcRsrcName",SWIG_RcRsrcName,TCL_GLOBAL_ONLY);
#if TK_MAJOR_VERSION >= 4
int main(int argc, char **argv) {
if (MacintoshInit() != TCL_OK) {
Tk_Main(argc, argv, Tcl_AppInit);