ITT Rule IDL Version 7.0 User Manual Page 289

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 288
Chapter 12: Using iTool User Interface Elements 289
iTool Developer’s Guide Prompts
Prompts
Prompts solicit information from the user. Prompts are generally presented as modal
dialogs, meaning that the user must respond to the prompt before operation of the
iTool can continue.
The IDLitIMessaging class provides two methods that prompt for user input:
PromptUserYesNo and PromptUserText. See “IDLitIMessaging” (IDL Reference
Guide) for additional details on these methods.
PromptUserYesNo
The IDLitIMessaging::PromptUserYesNo method displays a prompt string along
with Yes and No buttons. In the standard iTool interface created using the IDL
widget toolkit, Yes/No prompts appear as modal dialogs as shown in Figure 12-2.
Note
The PromptUserYesNo function returns 1 if the dialog executed properly. You
must check the value stored in the variable specified as the Answer argument to
determine which button the user pressed.
The following code asks the user a Yes or No question and performs some action if
the dialog returns properly and the value of the returned variable
answer is equal to
1 (as would be the case if the user clicked Yes) :
status = self->PromptUserYesNo('Overwrite Variable: Plot_Y?', $
answer, TITLE='Overwrite Variable?')
IF (status NE 0 && answer EQ 1) THEN BEGIN
; do something...
ENDIF
The value of the TITLE keyword is displayed in the title bar of the dialog box.
Figure 12-2: Yes/No and Text Prompt dialogs.
Page view 288
1 2 ... 284 285 286 287 288 289 290 291 292 293 294 ... 429 430

Comments to this Manuals

No comments