Create New Tcl Commands
The Tcl interface allows you to manipulate the trace using Tcl scripts. This chapter covers the basics about writing Tcl scripts and executing them in VOV. In fact, most VOV commands such as vsr and vovforget are implemented by means of Tcl scripts.
Tcl Interpreters with VOV Extensions
- For interactive use, choose in the Console.
- For batch processing you can choose between vovbuild and
vovsh. The two tools differ in their behavior after
the script has been executed. Use vovbuild with the -f option. After the script has completed, vovbuild exits.
% vovbuild -f <tclScript>
Use vovsh with the -f option. After the script has completed, vovsh enters a loop to manage the user interface and exits when the top level window of the user interface is dismissed. If no window is created by the script, vovsh exits immediately.% vovsh -f <tclScript>
vovClientInit tk ; # Initialize Tk.
vovClientInit tix; # Initialize Tk and Tix.
vovClientInit all; # Initialize all packages, i.e. Tk and Tix.
These interpreters also have access to all the VOV extensions, that is all the "vtk" procedures. For more information on the vtk procedures, refer to the VOV/Tcl Interface section in the VOV Reference Guide.
Tcl Intepreters without VOV Extensions
- we use a different name to avoid conflicts with other versions of tclsh;
- vtclsh is instrumented with VIL, the VOV Instrumentation Library;
- by default, vtclsh uses the libraries included in the VOV distribution.
The other interpreter is wish, which differs from the original only because it is an instrumented tool.
Many scripts in the VOV distribution use vtclsh.
% vtclsh <script>
% wish -f <script>