## The `Trigger' method

Argument: Character vector containing a callback property name
Result: None

Valid for: Any control

The `Trigger` method provides a general way for invoking a callback function, and thus in a sense can be used to simulate any event. It allows your program to cause a callback associated with a particular object and event to run. It takes as an argument the name of an event, and triggers the callback (if any) for that event. For example, to invoke the Double Click handler callback for a List object, you could enter:

         MyWin.List.Trigger 'onDblClick'

Note that running this method invokes the callback function, but does not otherwise affect the object concerned. Using the `Trigger` method can help avoid duplication of code. It also allows you to create custom controls by taking over event handling, and triggering higher-level events where appropriate (see the next chapter for further information on this subject). For example, you might want to achieve the effect of a custom Check box control which changed color when selected. To do this, you might define an `onMouseDown` callback function, which handled the color change, and which then called the `Trigger` method to create an `onClick` event for the object.

Topic: APLX Help : System Classes : Methods : Trigger

[ Previous | Next | Contents | Index ]