tkAppInit.cc File Reference

#include <tk.h>
#include "config.h"
#include "bitmap/play.xbm"
#include "bitmap/stop.xbm"
#include "bitmap/rewind.xbm"
#include "bitmap/ff.xbm"

Include dependency graph for tkAppInit.cc:

Go to the source code of this file.

Functions

 abort ()
 init_misc ()
void loadbitmaps (Tcl_Interp *tcl)
int main (int argc, char **argv)
int Tcl_AppInit (Tcl_Interp *interp)


Function Documentation

abort  ) 
 

Definition at line 156 of file tkAppInit.cc.

References abort().

00157 {
00158     Tcl& tcl = Tcl::instance();
00159     tcl.evalc("[Simulator instance] flush-trace");
00160 #ifdef abort
00161 #undef abort
00162     abort();
00163 #else
00164     exit(1);
00165 #endif /*abort*/
00166     /*NOTREACHED*/
00167 }

Here is the call graph for this function:

init_misc  ) 
 

Definition at line 228 of file misc.cc.

00229 {
00230     (void)new VersionCommand;
00231     (void)new RandomCommand;
00232     (void)new TimeAtofCommand;
00233     (void)new HasInt64Command;
00234     (void)new HasSTLCommand;
00235 #if defined(HAVE_INT64)
00236     (void)new Add64Command;
00237     (void)new Mult64Command;
00238     (void)new Int64ToDoubleCommand;
00239 #endif
00240 }

void loadbitmaps Tcl_Interp *  tcl  ) 
 

Definition at line 57 of file tkAppInit.cc.

Referenced by Tcl_AppInit().

00058 {
00059     Tk_DefineBitmap(tcl, Tk_GetUid("play"),
00060             play_bits, play_width, play_height);
00061     Tk_DefineBitmap(tcl, Tk_GetUid("stop"),
00062             stop_bits, stop_width, stop_height);
00063 
00064     Tk_DefineBitmap(tcl, Tk_GetUid("rewind"),
00065             rewind_bits, rewind_width, rewind_height);
00066     Tk_DefineBitmap(tcl, Tk_GetUid("ff"),
00067             ff_bits, ff_width, ff_height);
00068 }

int main int  argc,
char **  argv
 

Definition at line 45 of file tkAppInit.cc.

References Tcl_AppInit().

00046 {
00047     Tk_Main(argc, argv, Tcl_AppInit);
00048     return 0;           /* Needed only to prevent compiler warning. */
00049 }

Here is the call graph for this function:

int Tcl_AppInit Tcl_Interp *  interp  ) 
 

Definition at line 92 of file tkAppInit.cc.

References et_ns_lib, init(), init_misc(), and loadbitmaps().

00093 {
00094     if (Tcl_Init(interp) == TCL_ERROR) {
00095     return TCL_ERROR;
00096     }
00097     if (Otcl_Init(interp) == TCL_ERROR) {
00098     return TCL_ERROR;
00099     }
00100     if (Tk_Init(interp) == TCL_ERROR) {
00101     return TCL_ERROR;
00102     }
00103 
00104     Tcl_StaticPackage(interp, "Tk", Tk_Init, (Tcl_PackageInitProc *) NULL);
00105 #ifdef TK_TEST
00106     if (Tktest_Init(interp) == TCL_ERROR) {
00107     return TCL_ERROR;
00108     }
00109     Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
00110             (Tcl_PackageInitProc *) NULL);
00111 #endif /* TK_TEST */
00112 
00113 
00114     /*
00115      * Call the init procedures for included packages.  Each call should
00116      * look like this:
00117      *
00118      * if (Mod_Init(interp) == TCL_ERROR) {
00119      *     return TCL_ERROR;
00120      * }
00121      *
00122      * where "Mod" is the name of the module.
00123      */
00124 #ifdef HAVE_LIBTCLDBG
00125     if (Dbg_Init(interp) == TCL_ERROR) {
00126     return TCL_ERROR;
00127     }
00128 #endif
00129 
00130     Tcl::init(interp, "ns");
00131     Tcl::instance().tkmain(Tk_MainWindow(interp));
00132     extern EmbeddedTcl et_ns_lib, et_tk;
00133     et_tk.load();
00134     et_ns_lib.load();
00135     init_misc();
00136     loadbitmaps(interp);
00137 
00138 
00139     /*
00140      * Call Tcl_CreateCommand for application-specific commands, if
00141      * they weren't already created by the init procedures called above.
00142      */
00143 
00144     /*
00145      * Specify a user-specific startup file to invoke if the application
00146      * is run interactively.  Typically the startup file is "~/.apprc"
00147      * where "app" is the name of the application.  If this line is deleted
00148      * then no user-specific startup file will be run under any conditions.
00149      */
00150 
00151     Tcl_SetVar(interp, "tcl_rcFileName", "~/.ns.tcl", TCL_GLOBAL_ONLY);
00152 
00153     return TCL_OK;
00154 }

Here is the call graph for this function:


Generated on Tue Mar 6 17:01:27 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6