2 // SWIG Interface file for building a new version of itkwish
9 %subsection "itkwish.i"
11 This module provides a main() program needed to build a new version
12 of the [incr Tcl] 'itkwish' executable. It has been tested with itcl 2.1,
13 but may need tweaking for later versions and for use with C++.
22 * Provides a default version of the Tcl_AppInit procedure for
23 * use in wish and similar Tk-based applications.
25 * Copyright (c) 1993 The Regents of the University of California.
26 * Copyright (c) 1994 Sun Microsystems, Inc.
28 * See the file "license.terms" for information on usage and redistribution
29 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
33 static char sccsid[] = "@(#) tkAppInit.c 1.15 95/06/28 13:14:28";
38 EXTERN int Itcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
39 EXTERN int Itk_Init _ANSI_ARGS_((Tcl_Interp *interp));
42 * The following variable is a special hack that is needed in order for
43 * Sun shared libraries to be used for Tcl.
46 #ifndef SWIG_RcFileName
47 char *SWIG_RcFileName = "~/.itkwishrc";
51 static int (*dummyMathPtr)() = matherr;
55 *----------------------------------------------------------------------
59 * This is the main program for the application.
62 * None: Tk_Main never returns here, so this procedure never
66 * Whatever the application does.
68 *----------------------------------------------------------------------
73 int argc; /* Number of command-line arguments. */
74 char **argv; /* Values of command-line arguments. */
76 Tk_Main(argc, argv, Tcl_AppInit);
77 return 0; /* Needed only to prevent compiler warning. */
81 *----------------------------------------------------------------------
85 * This procedure performs application-specific initialization.
86 * Most applications, especially those that incorporate additional
87 * packages, will have their own version of this procedure.
90 * Returns a standard Tcl completion code, and leaves an error
91 * message in interp->result if an error occurs.
94 * Depends on the startup script.
96 *----------------------------------------------------------------------
101 Tcl_Interp *interp; /* Interpreter for application. */
103 if (Tcl_Init(interp) == TCL_ERROR) {
106 if (Tk_Init(interp) == TCL_ERROR) {
111 * Call the init procedures for included packages. Each call should
114 * if (Mod_Init(interp) == TCL_ERROR) {
118 * where "Mod" is the name of the module.
120 if (Itcl_Init(interp) == TCL_ERROR) {
123 if (Itk_Init(interp) == TCL_ERROR) {
126 if (SWIG_init(interp) == TCL_ERROR) {
130 if (Tcl_PkgRequire(interp, "Iwidgets", (char*)NULL, 0) == NULL) {
135 * Call Tcl_CreateCommand for application-specific commands, if
136 * they weren't already created by the init procedures called above.
140 * Specify a user-specific startup file to invoke if the application
141 * is run interactively. Typically the startup file is "~/.apprc"
142 * where "app" is the name of the application. If this line is deleted
143 * then no user-specific startup file will be run under any conditions.
146 Tcl_SetVar(interp, "tcl_rcFileName", SWIG_RcFileName, TCL_GLOBAL_ONLY);