Hi. I'm trying to run a TK script from a c++ program using Tk_Main. It all works, but by default, Tk_Main creates an interactive shell. Instead, I just want to run a script (file), then exit. (So all I would get is the wish-like window, not the console. I've tried setting
Tcl_SetVar(interp, "tcl_rcFileName", "<script file>", TCL_GLOBAL_ONLY);
where <script file> is the script I want to run, in Tcl_AppInit. This works to run the script, but it still has the console window open in the background. Is there a way to do this through Tk_Main and the AppInit functions, or do I have to do something manually?
I noticed in the Tk_Init manual page:
If there is a variable argv in interp, Tk_Init treats the contents of this variable as a list of options for the new Tk application. The options may have any of the forms documented for the wish application (in fact, wish uses Tk_Init to process its command-line arguments).
And I know that if you give a filename argument to wish, it runs that script instead of opening the console, but I'm not sure how to set argv "in" interp.
Thanks for any help..
Tcl_SetVar(interp, "tcl_rcFileName", "<script file>", TCL_GLOBAL_ONLY);
where <script file> is the script I want to run, in Tcl_AppInit. This works to run the script, but it still has the console window open in the background. Is there a way to do this through Tk_Main and the AppInit functions, or do I have to do something manually?
I noticed in the Tk_Init manual page:
If there is a variable argv in interp, Tk_Init treats the contents of this variable as a list of options for the new Tk application. The options may have any of the forms documented for the wish application (in fact, wish uses Tk_Init to process its command-line arguments).
And I know that if you give a filename argument to wish, it runs that script instead of opening the console, but I'm not sure how to set argv "in" interp.
Thanks for any help..