- use a dialog box to prompt
for a number and return the user's response.
Boolean XmtAskForDouble(Widget w,
String query_name, String prompt_defaul t,
double *value_in_out, double min, double
max, String help_text_default)
Boolean XmtAskForInteger(Widget w, String
query_name, String prompt_default, int
*value_in_out, int min, int max,
- The shell widget over which the dialog will be displayed, or any
descendant of that shell.
- The name of this instantiation of the dialog; used to look up resources.
NULL may be specified, but will result in a dialog that cannot be
customized through the resource database.
- The prompt message to be displayed in the dialog, unless an overriding
value is found in the resource database.
- The address of a double or int owned by the caller. On entry
to these functions, this variable contains the default value to be
presented to the user.
- The minimum number that the user will be allowed to enter.
- The maximum number that the user will be allowed to enter.
- The help text to display when the user clicks the Help button,
unless an overriding value is found in resource database. NULL may
value_in_out The address of a double or
int owned by the caller. When these functions return True, the
value entered by the user is stored at this address.
if the user clicked the Ok
button to dismiss the dialog;
if the user clicked the Cancel
display an application
modal dialog box, of the type created by XmCreatePromptDialog()
prompt the user to enter a number. They process events in a local event loop
until the user selects either the Ok
button of the
dialog, and then return control to the calling procedure. If the user enters a
legal number in the correct range, and clicks Ok
, then that number is
stored at the location pointed to by the value_in_out
argument, and the
functions return True
. If the user clicks the Cancel
functions immediately return False
without checking or storing the
If the user clicks Ok
, and the value entered is not a valid number (e.g.
if it contains illegal characters), or if it is not within the minimum and
maximum bounds specified for this dialog, then an error message is displayed
(using XmtDisplay Error()
) and control remains within the local
event loop so that the user can correct his input. If range checking is not
desired with these functions, specify a min
value that is greater than
or equal to max
If help text is found in the resource database for this dialog, or if the
argument is non- NULL
, then this text will be
displayed (using XmtDisplayInformation()
) when the user clicks on the
button. If there is no help available for the dialog, then the
button will be insensitive.
To allow dialog customization, XmtAskForDouble()
look up the following subpart resources of the shell
specified by w
. The name of the subpart is given by the
argument, and the class of the subpart is ``
'' or `` XmtIntDialog
''. These subpart resources
are looked up every time these functions are called, not simply when the
widgets are created.
||The prompt for the dialog
||”Enter an Integer“ or ”Enter a Number“
||The string to appear in the dialog's titlebar.
||Online help for the dialog.
use the same cached
dialog widgets as XmtAskForString()
does-an XmDialogShell named ``
'' and its XmSelectionBox child named ``
Chapter 26, Simple Input Dialogs