NAB plug-in for MWT user guide June 21, 2006
Contents PreviousNext

Chapter 2 Creating a Simple Application, Hello

2.6 Creating an Event Procedure

Allocated instances in a running application window generate events that vary depending on mouse motions and size changes made.

In this tool, a procedure that is set for an event is referred to as an event procedure.

Create an event procedure that displays "Hello!" when the button in the Hello application window is clicked.

 

This section explains the procedure for creating an event procedure.

  Procedure

  1. In the [NAB/MWT Tree] view or [NAB/MWT Editor] view, select the button instance for generating the event, and select [New] icon in the [NAB/MWT Procedures] view.

    Figure: Selecting a new event procedure

  2. The [Create Procedure] dialog box appears. Specify the following values.

    Setting item

    Value

    Procedure name

    new_ep

    Function name

    btn_ep

    Trigger

    ACTIVATE

    Figure: [Create Procedure] dialog box

  3. Enter the following code in the btn_ep function of the event procedure by using the source code editor:

    object->setProperty(WSNlabelString,"Hello!");

    Figure: Window displayed after this addition is made with the source code editor

    If Java is the language used, add the following code in the btn_ep function:

    object.setProperty("labelString","Hello!");


Contents PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2005-2006