A SERVICE OF

logo

302 Chapter 13: Creating a User Interface Service
Registering a UI Service iTool Developer’s Guide
Registering a UI Service
Before a user interface service can be called from an iTool, the routine that
implements the service must be registered with the iTool system. Registering a UI
service with the system links the file containing the actual IDL code that creates the
user interface elements with a simple string that names the UI service. Since you use
the name string in code that calls the service, the iTool itself does not need to know
anything about the display environment in which it is running.
User interface services are registered either using the ITREGISTER procedure or via
a call to the RegisterUIService method of the IDLitUI object. In most cases,
registration is accomplished via a call to the ITREGISTER procedure in an iTool’s
launch routine. A UI service can be registered at any time. In practice, you will
probably find it convenient to register UI services used by an iTool in the iTool
launch routine, unless you know the service has already been registered. For a list of
UI services that are pre-registered by the standard iTools, see “Predefined iTool UI
Services” on page 295.
Using ITREGISTER
Use the ITREGISTER routine to register a user interface service:
ITREGISTER, '
UI Service Name
', '
UI_Service_Routine
', /UI_SERVICE
where UI Service Name is a string you will use to call the user interface service, and
UI_Service_Routine is a string that specifies the name of the file that contains the
code for the user interface service.
Note
The file
UI_Service_Routine
.pro must exist somewhere in IDL’s path for the
service definition to be successfully registered.
If a given user interface service has already been registered when the ITREGISTER
routine is called, the service will not be registered a second time. The registration can
be performed at any time in an IDL session before you attempt to call the user
interface service.
See “ITREGISTER” (IDL Reference Guide) for details.