Get

GetNewC

Create a Get for a text variable

Syntax

Signature
Get *GetNewC( int row, int col, char *value, int size, const char *name, const GetOpts *opts );

Arguments

row, col the terminal position of the field; NIL uses the cursor position.

value the text variable, a char array.

size the size of the array with the terminating 0; NIL uses the length of the text plus 1.

name the name of the variable, or NULL for "".

opts points to a GetOpts structure, or NULL for defaults.

Return value

The new Get object, or NULL when value is NULL. Release it with GetFree().

Description

Include xdev-wtui-classes.h. The Get edits the variable in place: the field has size - 1 characters, and GetAssign() never writes more than size - 1 bytes. `GetOpts` gives the picture, the colors, the WHEN and VALID callbacks, the caption, the message and the cargo; the texts are copied. The Get is not drawn: call GetDisplay().

A macro of the program can give the name of the variable like `@ ... GET` in xBase:

`#define GET_C( row, col, var, opts ) GetNewC( row, col, var, sizeof( var ), #var, opts )`

See also