Studio > Using Rogue Wave Script > Using Rogue Wave Script for Rogue Wave Views in your Application > Callbacks
 
Callbacks
A callback that you attach to an object can be written either in C++ or in Rogue Wave Script. In jsstudio, you can specify the language you want to use in the Generic Inspector at the bottom of the Main window or in the Callbacks Inspector.
If most of your callbacks are written in Rogue Wave Script for Rogue Wave Views, you might want the callback language to default to JvScript. (JvScript is the symbolic name of Rogue Wave Script for Rogue Wave Views.) In this case, you can set the defaultCallbackLanguage option to JvScript in an option file.
To attach a callback written in Rogue Wave Script to an object, you can either enter a name in the callback field and select the IS toggle button to its right in the Generic Inspector or enter a name and select the Script toggle button to the right of the Value field in the Callbacks page of the object inspector panel (see Figure 4.1).
Figure 4.1    Callbacks Page of the Button Inspector Panel
You can access the object inspector panel by either double clicking the object or by selecting the object and clicking .
You can click the button to the right of the Script toggle to find and edit the Rogue Wave Script function corresponding to the specified callback. If this function is not defined in the inline script attached to the buffer, a sample function will be automatically generated.
The Rogue Wave Script function that you define must have the same name as its associated callback. It will be invoked whenever the callback is triggered. The function receives the graphic object to which the callback is associated as its first argument. If you specify a value for the callback in the Value column of the Callback Inspector, this value is passed as the second parameter to the function.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.