How Do I...

Prompt for path and file names

Add forms No tip for this topic Example: Open and save files Prompt for text input

If your application uses files stored on disk, you might need to display a window that allows users to select a file to open or to save.

Adding a file selection prompter

To display a window from which users can select a file, add a File Selection Prompter part:

  1. Go to a Composition Editor open on a visual part in your application.
  2. Select Prompter category icon (Prompter category) and File Selection Prompter icon (File Selection Prompter part).
  3. Click on the free-form surface.

Changing the settings for the prompter

Define what the prompter displays by changing its settings:

  1. Open the File Selection Prompter part's Properties window.
  2. Specify the title, any searchPath or selectedFileName, and the accessType as either XmOPEN or XmSAVE.

    XmOPEN
    Opens a designated file.

    XmSAVE
    Saves work to a designated file.

Connecting the prompter to other parts

After you define a prompter, make an event-to-action connection so the prompter displays when the event occurs. Connect the event, such as clicked for a push button, to the prompt action of the File Selection Prompter part.

Also, make an attribute-to-attribute connection that passes a path and file name as a parameter.


[ Top of Page | Previous Page | Next Page | Table of Contents ]