DESIGN (xvutils) functions


LIBRARY ROUTINE

xvu_query_wait - pop up prompt widget; wait for response

LIBRARY CALL

int  xvu_query_wait(
   char *top_label,
   char *prompts[],
   char *button,
   char *answers[],
   int  num_prompts,
   int  size)

INPUT

OUTPUT

none

RETURN VALUE

1 if user selected "Ok" 0 if user selected "Cancel"

DESCRIPTION

Creates a pop-up query object in order to prompt more responses from the user; xvu_query_wait may be used to obtain a set of strings, floats, integers, or responses of mixed types from the user.

Will not return control to application program until the user selects "Ok" or "Cancel".

The prompts[] and answers[] arrays must be of the same size, where that size is specified as 'num_prompts'.

The prompts[] array must be completely filled out with 'num_prompts' strings giving appropriate prompt for each response desired.

The answers[] array must be dynamically allocated, and each element of the string array should be initialized to contain the string representation of the default (if any). Strings should be passed in as NULL if no default is appropriate). The defaults will appear in the text objects when the query object is popped up; when the user clicks on "Ok", the contents of the answers[] array will be freed if non-NULL, and the responses of the user will be substituted in their place.

When the caller is prompting for float, int, or other non-string responses, it is expected that the caller will convert the responses returned in the answers[] array to their appropriately typed counterparts before use.

The 'size' argument is provided to ensure that the text objects are physically large enough to accomodate the user's response.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

The strings in the answers[] array will be freed if non-NULL, and the responses of the user substituted. If the user leaves the default in place, that will be returned; if the user blanks out a string, NULL is returned.

RESTRICTIONS

none

MODIFICATION

none

FILES

$DESIGN/objects/library/xvutils/src/query.c

SEE ALSO

xvutils(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.