Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
XmtAskForDouble(3)	    Library Functions Manual	      XmtAskForDouble(3)

NAME
     XmtAskForDouble(),  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)

ARGUMENTS
     INPUTS

	  w	 The shell widget over which the dialog will  be  displayed,  or
		 any descendant of that shell.

	  query_name
		 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.

	  prompt_default
		 The  prompt  message  to  be displayed in the dialog, unless an
		 overriding value is found in the resource database.

	  value_in_out
		 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.

	  min	 The minimum number that the user will be allowed to enter.

	  max	 The maximum number that the user will be allowed to enter.

	  help_text_default
		 The  help text to display when the user clicks the Help button,
		 unless an overriding value is found in resource database.  NULL
		 may be specified.
     OUTPUTS
	  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.

DESCRIPTION
     XmtAskForDouble() and XmtAskForInteger() display an application modal  dia-
     log  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  con-
     trol  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  dis-
     played  (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 in-
     sensitive.

     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  re-
     sources  are  looked  up  every time these functions are called, not simply
     when the widgets are created.

     +----------+---------------------+----------------------+
     | Resource | Default	      | Description	     |
     +----------+---------------------+----------------------+
     | message	| prompt_default      | The prompt for the   |
     |		|		      | dialog		     |
     +----------+---------------------+----------------------+
     | title	| "Enter an Integer"  | The string to appear |
     |		| or "Enter a Number" | in the dialog's ti-  |
     |		|		      | tlebar. 	     |
     +----------+---------------------+----------------------+
     | helpText | help_text_default   | Online help for the  |
     |		|		      | dialog. 	     |
     +----------+---------------------+----------------------+

     WIDGETS

     XmtAskForDouble() and XmtAskForInteger() use the same cached dialog widgets
     as XmtAskForString() does-an XmDialogShell  named	``xmtStringDialogShell''
     and its XmSelectionBox child named ``xmtStringDialog''.

SEE ALSO
     Chapter 26, Simple Input Dialogs,
     XmtAskForBoolean(), XmtAskForFile(), XmtAskForFilename(), XmtAskForItem(),
     XmtAskForItemNumber(), XmtAskForString().

Xmt				   Motif Tools		      XmtAskForDouble(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=XmtAskForDouble&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help