|w||An XmtMsgLine widget.|
|len||The size of the character buffer buf.|
buf For XmtMsgLineGetString(), a character buffer in which the users input will be returned. value_return The address of a double, int or unsigned variable in which the users numeric input will be returned.
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.
XmtMsgLineGetString() 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 users 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.
Chapter 22, The Message Line,
XmtMsgLine, XmtMsgLineClear(), XmtMsgLineGetInput(), XmtMsgLinePop(), XmtMsgLinePrintf(), XmtMsgLinePush(), XmtMsgLineSet(), XmtMsgLineSetInput().
|Xmt||XMTMSGLINEGETSTRING (3)||Motif Tools|