CommonWidgets provides three prompters that can be used to prompt the user for information required by the application. The user must reply to the prompt before the application can continue execution. The following three prompters are provided:
Prompters are an extension of the OSF/Motif API implemented using the platform's native prompters, where available. Prompters are not widgets, but provide a convenient, portable mechanism to access platform-specific prompting services.
The CwMessagePrompter provides functionality similar to the CwMessageBox widget described earlier. The difference is that CwMessagePrompter uses the platform's message prompter, whereas CwMessageBox provides the behavior of the Motif message box. On Motif platforms, CwMessagePrompter is implemented using CwMessageBox.
Prompters can be created in two ways:
A prompter can be configured with several settings, described below. Default values are provided for all settings of a prompter.
The modality of a prompter can be changed using the prompterStyle: method. Valid prompter styles, in order of restrictiveness, are:
If a platform does not support the specified prompter style, the style is promoted to the next most restrictive style. If no more restrictive style exists, the style is demoted to the next less restrictive style.
The title of the prompter can be set using the title: method.
A prompter is popped up using the prompt method. Control is not returned to the application until the user responds to the prompter. The value returned by the prompt method is nil if the user cancels the prompter. If the user replies to the prompter without cancelling, the value returned depends on the type of prompter.