|
|
The first line of Main opens a connection to the server with VtOpen(VTCL):
set app [VtOpen Example]
VtOpen requires a string to be passed along with it as an argument. This string (in our case, ``Example'') identifies the application.
VtOpen returns a ``handle'' in response to the command set app [VtOpen Example].
This handle is stored in the variable app and will be used as the top of the ``widget tree''. The widget tree is similar to a tree of files and directories, with each widget requiring a parent (and many having children).
The handle returned from VtOpen becomes the ``root'' (parent)
of the widget tree.
The square brackets indicate to SCO Visual Tcl that a command is to be executed. This is similar to back-quoting in shell programming. The set app line results in the variable app being set to the result of the command enclosed within brackets (VtOpen Example).
To refer to the value of a variable, precede it with a dollar sign ($). For example, to access the value of the app variable, refer to it as $app.