How Do I...

Example: Prompt for a new name

Prompt for text input No tip for this topic No example for this topic Use view wrappers

This example shows how to make a simple application that prompts users for a new name for a window. The application uses a Text Prompter part and push buttons.

Adding the using interface

Begin by creating an application, adding a visual part to it, and opening a Composition Editor on the visual part. Next, add two Push Button parts to the Window part shown in the Composition Editor. Buttons category icon (Buttons category).

After you add the push buttons, change their labels and arrange them so the user interface looks like the following:
Window with push buttons

Adding the Text Prompter part

Next, add the text prompter:

  1. Select Prompter category icon (Prompter category) and Text Prompter icon (Text Prompter part).
  2. Click on the free-form surface.

Changing the settings for the prompter

Define what the prompter displays by changing its settings:

  1. Open the Text Prompter part's Properties window..
  2. Specify the following text in the appropriate fields:

    title
    Name the Window

    messageString
    Type in a new title for the window:

    defaultAnswerString
    This Window

Connecting the prompter to other parts

Make the following connections:

Finally, test the application. When you select Rename, the text prompter opens.


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