VAddText
Name
VAddText - adds a new Text (Tablet) Item to the list.
Synopsis
VAddText(win, x, y, width, label, value, proc, ID)
Window win;
int x, y, width;
char *label;
char *value;
int (*proc)();
TEXT **ID; /*RETURN*/
Description
VAddText adds a new Text (Tablet) Item to the list of tablets. VAddText
returns the Text to ID. The tablets created by VAddText are displayed
immediately and are active (will aceept mouse button and keyboard presses).
Structures
typedef struct _text {
Window win; /*window in which item resides*/
GC *gc;
int x,y; /*location of upper-left corner of item*/
int w; /*width of the total item area in fonts*/
int h; /*height of the total item area in PIXELS*/
short label_width; /*width of label in pixels*/
short label_height; /*height of label*/
short label_ascent; /*ascent dimension of font*/
short label_x; /*position of the label*/
short label_y;
int thick; /*thickness of the frame of the item*/
int width; /*current width of item in pixels*/
int fw,fh; /*size of font*/
char label[150]; /*label of the text item*/
char value[200]; /*value of the text item*/
int pos; /*pos indicates the index of the first VALUE*/
int state; /*indicates if text item is OFF(0) or ON(1)*/
int mode; /*text item is DISABLED(0) or ENABLED (1)*/
int (*func)(); /*notify procedure*/
struct _text *next; /*next text item*/
XFontStruct *font_struct; /*Font used on the window*/
} TEXT;
Return Value
0 - work successfully.
1 - memory allocation error.
Parameters
win - window containing the Text Item (any window).
x,y - location of the Item within the window; if the location is not
within the window, the tablets are are not displayed but no error
is returned.
width - maximum width of item (label+value) in font_width units.
label - string representing the label of the Item.
value - string representing the contents of the Item; this value is copied
to the TEXT structure internally.
proc - notify procedure(when "return" is hit); no parameters can be passed
to the procedure; if proc is NULL it is not executed but no error
returned.
ID - address of the Text Item ID; it is dynamically allocated. It is freed
only when the tablet is destroyed (VDeleteText) or if the entire list
of tablets is cleared from memory (VClearTextList).
Side Effects
None.
Entry Conditions
None.
Related Functions
VCheckTextEvent,
VClearTextList,
VDeleteText,
VSetTextOff,
VSetTextOn,
VSetTextLoc,
VSetTextValue,
VGetTextIdbyValue.