
Main Window doesn't show up in my tk app
I wrote the following main program:
--------------------------------------------------------------------
/**
* Test for tk
*/
#include <stdio.h>
#include <tk.h>
int Tcl_AppInit(Tcl_Interp *interp)
{
if (Tcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
(Tcl_PackageInitProc *) NULL);
#endif /* TK_TEST */
/*
* Call the init procedures for included packages. Each call should
* look like this:
*
* if (Mod_Init(interp) == TCL_ERROR) {
* return TCL_ERROR;
* }
*
* where "Mod" is the name of the module.
*/
/*
* Call Tcl_CreateCommand for application-specific commands, if
* they weren't already created by the init procedures called above.
*/
/*
* 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.
*/
Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
return TCL_OK;
Quote:
}
int main (int argc, char * argv [])
{
Tcl_Main (argc, argv, Tcl_AppInit);
return 0;
Quote:
}
-----------------------------------------------------------------------
I think this should work the same way as wish. But it only shows the
command prompt and no window. Why?
--
Schnepfwinkelstr. 10 Phone: +41 62 797 7908
CH-5745 Safenwil
Switzerland
-------------------------------------------------