GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
XmtAskForDouble(3) FreeBSD Library Functions Manual XmtAskForDouble(3)

XmtAskForDouble(), XmtAskForInteger() - use a dialog box to prompt for a number and return the user's response.

#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)

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.

XmtAskForDouble() 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.

Resource Default Description
message prompt_default The prompt for the dialog
title ”Enter an Integer“ or ”Enter a Number“ The string to appear in the dialog's titlebar.
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''.

Chapter 26, Simple Input Dialogs,
XmtAskForBoolean(), XmtAskForFile(), XmtAskForFilename(), XmtAskForItem(), XmtAskForItemNumber(), XmtAskForString().
Motif Tools Xmt

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.