Before leaving this section,
let's briefly summarize the steps needed to create new Tcl/Tk commands
in C using ET.
First you create one or more commands using the ET_PROC
construct, as follows:
ET_PROC( name-of-the-new-command ){ /* C code to implement the command */ return ET_OK; /* Don't forget the return value! */ }Then, you register these commands with the Tcl interpreter using an
ET_INSTALL_COMMANDS
statement after the
Et_Init()
function call within main()
.
Like this:
ET_INSTALL_COMMANDS( name-of-file-containing-ET_PROCs.c );And that's all you have to do!
The ET_PROC
construct lets you
put a C routine in the middle of Tcl/Tk.
The next section will take a closer look at ET()
which
allows you to put Tcl/Tk in the middle of a C routine.