|
NAMEXmtMsgLineGetString(), XmtMsgLineGetDouble(), XmtMsgLineGetInt(), XmtMsgLineGetUnsigned(), XmtMsgLineGetChar() - use an XmtMsgLine widget to synchronously get input from the user.SYNOPSIS#include <Xmt/MsgLine.h>
String XmtMsgLineGetString(Widget w, String buf, int len) Boolean XmtMsgLineGetDouble(Widget w, double *value_return) Boolean XmtMsgLineGetInt(Widget w, int *value_return) Boolean XmtMsgLineGetUnsigned(Widget w, unsigned *value_return) int XmtMsgLineGetChar(Widget w) ARGUMENTSINPUTS
OUTPUTS
RETURNS XmtMsgLineGetString() returns buf, or NULL when cancelled. The numeric input functions return True for valid input, or False when cancelled. XmtMsgLineGetChar() returns the input character, or EOF when cancelled. DESCRIPTIONXmtMsgLineGetString() transfers keyboard focus to the XmtMsgLine widget w, disallows events to any other widgets, and enters an internal event loop to wait for the use to enter a string. When the user strikes Return, it copies the input string into buf, and null-terminates it. Then it resumes normal event handling, restores keyboard focus to its original location and returns buf. The user's input is guaranteed not to be longer than len-1 characters. The user can also cancel the input, generally by typing Escape or Ctrl-C. In this case, XmtMsgLineGetString() does not modify the contents of buf and returns NULL.XmtMsgLineGetDouble(), XmtMsgLineGetInt(), and XmtMsgLineGetUnsigned() are closely related to XmtMsgLineGetString(). They also perform synchronous input, but only accept input characters that are legal in double, int, and unsigned values. When the user strikes Return, these functions convert the input to the appropriate numeric type, store it at the address specified by value_return and return True. If the user cancels the input, these functions return False without changing value_return. XmtMsgLineGetChar() also performs synchronous input. It waits for the user to enter a character into the specified XmtMsgLine widget and returns that character, or if the user cancels the input it returns the constant EOF (defined in the header file <stdio.h>). This function differs from the other XmtMsgLine synchronous input functions in that it does not require the user to strike the Return key to enter the input-it returns after any single character is typed. When using any of these functions, you must be sure to check their return values. If they return NULL, False or EOF then the user has requested that the operation in progress be cancelled. SEE ALSOChapter 22, The Message Line,XmtMsgLine, XmtMsgLineClear(), XmtMsgLineGetInput(), XmtMsgLinePop(), XmtMsgLinePrintf(), XmtMsgLinePush(), XmtMsgLineSet(), XmtMsgLineSetInput().
Visit the GSP FreeBSD Man Page Interface. |