Smart CODE | |
Your on-line guide to the generated code |
For Smart Code, the callback in the X-Designer stubs file will be preconfigured to callout to this UserCallbackProc. If you are developing in Motif and MFC in C++, the same callout routine will be called by both sets of callbacks. Where a new toolkit requires a different language (eg the AWT requires Java), the Smart Code API is designed so that migration from one language to another is a cosmetic exercise.
When the routine is called, you have access to a data object containing all the elements in the group associated with the callback. This group data object can be used to access and modify the values of any control in the group, without the need for programming with the Motif, MFC or Java AWT API.
In C, the callout is a routine. Smart Code data is passed in as arguments. In C++ and Java the callout is a class, a subclass of the Smart Code Data class. Its doit() method is called, and Smart Code data is accessed through getter methods, for example getGroup() and getPollInterval().
GROUPNAME and METHODNAME will be replaced in the generated code by the name you have given to your group, and your callback method.
Toolkit-Independent Programming example | |
---|---|
Language | Usage |
C |
|
C++ |
|
Java |
|