cnet v3.1.4

home
FAQ

cmdline options
topology files
attributes

datatypes
data structures
core API
support API

download/install

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.

cnet was written and is maintained by Chris McDonald (chris@csse.uwa.edu.au).

cnet development has been supported by an ACM-SIGCSE Special Project Grant, and an Australian Apple University Consortium Scholarship.