|
NAMEXmtAskForDouble(), XmtAskForInteger() - use a dialog box to prompt for a number and return the user's response.SYNOPSIS#include <Xmt/Dialogs.h>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, String help_text_default) ARGUMENTSINPUTS
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.
RETURNS
True if the user clicked the Ok button to dismiss the dialog; False if the user clicked the Cancel button. DESCRIPTIONXmtAskForDouble() and XmtAskForInteger() display an application modal dialog box, of the type created by XmCreatePromptDialog(), to prompt the user to enter a number. They process events in a local event loop until the user selects either the Ok or Cancel 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 button, the functions immediately return False without checking or storing the input value.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 help_text_default argument is non-NULL, then this text will be displayed (using XmtDisplayInformation()) when the user clicks on the Help button. If there is no help available for the dialog, then the Help button will be insensitive. Customization To allow dialog customization, XmtAskForDouble() and XmtAskForInteger() look up the following subpart resources of the shell specified by w. The name of the subpart is given by the query_name argument, and the class of the subpart is ``XmtDoubleDialog'' or ``XmtIntDialog''. These subpart resources are looked up every time these functions are called, not simply when the widgets are created.
WIDGETS XmtAskForDouble() and XmtAskForInteger() use the same cached dialog widgets as XmtAskForString() does-an XmDialogShell named ``xmtStringDialogShell'' and its XmSelectionBox child named ``xmtStringDialog''. SEE ALSOChapter 26, Simple Input Dialogs,XmtAskForBoolean(), XmtAskForFile(), XmtAskForFilename(), XmtAskForItem(), XmtAskForItemNumber(), XmtAskForString().
Visit the GSP FreeBSD Man Page Interface. |