\appendix
Appendix: The {\em hush} widget classes
The scale class
interface scale : widget {\c{\fbox{scale}}
scale(char* p, char* options = ""); scale(widget* w, char* p, char* options = ""); void text(char* s);\c{// text to display}
void from(int n);\c{// begin value}
void to(int n);\c{// end value}
int get();\c{// gets the value}
void set(int v);\c{// sets the value}
protected: install(action&, char* args); };
interface message : widget {\c{\fbox{message}}
message(char* p, char* options = "" ); message(widget* w, char* p, char* options = "" ); void text(char* s); };
interface button : widget {\c{\fbox{button}}
button(char* p, char* options = ""); button(widget* w, char* p, char* options = ""); void text(char* s);\c{// to display text}
void bitmap(char* s);\c{// to display a bitmap}
void state(char *s);\c{// to change the buttons state}
void flash(); char* invoke(); protected: install(action&,char* args); };
interface menubutton : button {\c{\fbox{menubutton}}
menubutton(char* p, char* options = ""); menubutton(widget* w, char* p, char* options = ""); void menu(char* s);\c{// to attach menu}
void menu(class menu* m); };
interface menu : widget {\c{\fbox{menu}}
menu(char* p, char* options = ""); menu(widget* w, char* p, char* options = ""); menu* add(char* s, char* options = ""); menu* entry(char* s,char* args ="", char* opts=""); menu* entry(char*,action&, char* ="", char* =""); menu* cascade(char* s, char* m, char* opts = ""); menu* cascade(char* s, menu* m, char* opts = ""); char* entryconfigure(int i, char* options); int index(char *s); int active();\c{// returns active index}
void del(int i);\c{// delete entry with index i}
void del(char* s);\c{// delete entry}
char* invoke(int i);\c{// invoke entry with index i}
char* invoke(char *s );\c{// invoke}
void post(int x = 500, int y = 500); void unpost(); protected: install(action&, char* args); };
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=""); };
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 .
The frame class
interface frame : widget {\c{\fbox{frame}}
frame(char* p, char * options = ""); frame(widget* w, char* p, char * options = ""); };
interface listbox : widget {\c{\fbox{listbox}}
listbox(char* p, char* options = ""); listbox(widget* w, char* p, char* options = ""); void insert(char* s); char* get(int d);\c{// entry with index d, starts from 0}
void singleselect(); protected: install(action&, char* args); };
interface entry : widget {\c{\fbox{entry}}
entry(char* p, char* options = ""); entry(widget* w,char* p, char* options = ""); void insert(char* s);\c{// insert text}
char* get();\c{// to get the text}
protected: install(action&, char* args); };
interface hypertext : widget {\c{\fbox{hypertext}}
hypertext(char* p, char* options = ""); hypertext(widget* w, char* p, char* options = ""); void file(char* f);\c{// to read in hypertext file}
};