|
|
cnet's Application Programming Interface
- NAME
- TCLTK - access cnet's Tck/Tk windowing interface
- SYNOPSIS
- #include <cnet.h>
void TCLTK(const char *fmt, ...);
- DESCRIPTION
-
When running as a GUI-based application,
cnet performs all drawing and management of its GUI
using the Tcl/Tk toolkit.
This enables you to focus on writing and evaluating protocols without
having to worry about the GUI.
However, there are many occasions when you may wish to interact with, or
extend, cnet's GUI.
The TCLTK function allows you to do this in a simplified manner.
The arguments to TCLTK are similar to those of C's printf,
and the standard format specifiers may be provided in the formatting string.
The Tcl/Tk variable $map is available for you to draw things on
the main simulation map.
For example, the call:
TCLTK("$map create rectangle %d %d %d %d -fill palegreen",
x, x+WIDTH, y, y+HEIGHT);
will draw a palegreen rectangle on the simulation map.
- SEE ALSO
-
The extensive features of Tcl/Tk are not documented with cnet,
and you may like to read Tcl/Tk's
online documentation.
|