interface canvas : widget { 
\c{\fbox{canvas}}
canvas(char *p, char* options=""); canvas(widget* w, char *p, char* options=""); void tag(int id, char* tag); char* tags(int id); void move(int id, int x, int y); void move(char* id, int x, int y); item bitmap(int x1, int y1, char* bm, char* opts=""); item line(int x1, int y1, int x2, int y2, char* opts =""); item line(char* linespec, char* opts =""); item circle(int x1, int y1, int rad, char* opts =""); item oval(int x1, int y1, int x2, int y2, char* opts =""); item polygon(char* linespec, char* opts =""); item rectangle(int x1,int y1,int ,int ,char* opts =""); item text(int x1, int y1, char* txt, char* opts=""); item window(int x1, int y1, char* w, char* opts=""); item current(); item overlapping(int x, int y); itemconfigure(int it, char* options); itemconfigure(char* tag, char* options); itembind(int it, char* s, action&, char* args = "" ); itembind(char* tg,char* s,action&, char* args = "" ); void postscript(char* file, char* options=""); };

slide: The canvas class

The canvas class

Apart from the two standard constructors, it offers the functions tag, tags and move that merely repeat the functions offered by the item class, except that move may also be given a tag to identify the items to be moved.

Currently, the graphic items bitmap, line, oval, polygon and rectangle may be created and, in addition, text items and window items consisting of a widget. The function overlapping may be used to retrieve the item overlapping a particular position.

In addition, the canvas class has auxiliary functions which are needed to support the functionality provided by the item class. The canvas may be written as Postscript to a file with the function canvas::postscript.