home *** CD-ROM | disk | FTP | other *** search
- FUNCTION getyn() - get a yes or no answer using a requestor
-
- getyn(window, string)
- struct Window *window;
- char *string;
-
- This function will get a simple yes or no answer from a user. You pass
- getyn() a string which is put into an AutoRequest(). If the user clicks
- o.k., TRUE is returned, otherwise FALSE. This function is useful in many
- situations to just let the user know what is going on, and of course for
- yes/no questions.
-
- If you pass getyn() a NULL window pointer, it will return NULL to you.
- If for any reason the AutoRequest() can not be made, this function will
- also return NULL. Therefore you should keep this in mind when you use
- getyn(). Also note that if there isn't enough memory for a full
- AutoRequest() (similar to the Insert Volume xxx requestors), the getyn()
- function will degenerate into a display alert (a recoverable guru box!).
- This can be scary for novice users, but only happens in *very* low memory
- conditions.
-
- The string you pass getyn() should fit horizontally on one line across
- the display. If not, the AutoRequest() will not open and you will get
- NULL back.
-
- Here is an example of using getyn() to find out if the user is really a
- weenie:
-
- struct Window *wind; /* assume it was opened earlier */
- int value;
-
- value = getyn(wind, " Are you a weenie? ");
- if (value == TRUE)
- user_is_a_weenie();
- else
- user_is_cool();
-
-
- Likewise, if you would just like to inform the user that something has
- happened or is about to happen, you can do the following:
-
- struct Window *wind; /* again, assume it was opened earlier */
-
- /* doing some processing and something occurs */
-
- getyn(wind, " Did you know that XXX just happened? ");
-
- /* keep going .... */
-
-
-
- TODO : would be nice if you could do multi-line requestors using some
- sort of embedded character to signify a line break.
-
- BUGS : None at time of publication.
-
- SEE ALSO : getstring(); makewin(); makescreen();
-
-
-