user manual

336 Chapter 15: Creating a Custom iTool Widget Interface
Overview of Creating an iTool Interface iTool Developer’s Guide
Create Event Handlers
While you do not need to handle the widget events that are internal to the iTool
compound widgets, you will need to create event handlers for any other widgets you
include in your interface. You will also need to provide event-handling code for the
following:
Resizing of the iTool compound widgets. This is generally accomplished by
calling the _RESIZE procedure associated with the compound widget.
Destruction of the iTool. In order to properly shut down the iTool system when
your iTool exits, you must call the iTools shutdown service in addition to
freeing any pointers used by the widget interface.
Focus changes. The iTool system needs to know which iTool is currently
selected. When your user interface receives the keyboard focus, you must call
the iTools set-as-current-tool service to alert the system that the iTool
associated with your interface has become the current tool.
Create Callback Routines
Callback routines handle messages delivered by the iTool messaging system to your
user interface. The number and type of callbacks your interface needs to handle will
depend on the features your user interface implements.
Create a Cleanup Routine
If your custom interface uses pointers or other variables that require explicit cleanup
when the application exits, you must provide a cleanup routine and specify it as the
routine to be called when the widgets are destroyed.
Create an iTool User Interface Object
iTools communicate with their user interfaces via a user interface object. Your
interface definition routine will need to create an interface object, register the widgets
with the object, and add the widget interface as an observer of the user interface
object.
Create an iTool Launch Routine
After creating the user interface definition routine, you will need to create an iTool
launch routine that does the following (in addition to any other work):