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.
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.
.promust 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 for details.
Suppose you have a UI service definition file named
myUIService.pro, located in a directory included in IDL's
ITREGISTER, 'My UI Service', 'myUIService', /UI_SERVICE
The user interface service can now be invoked via the DoUIService method:
success = oTool->DoUIService('My UI Service', self)
oTool is an object reference to the current iTool object.
User interface services can also be registered by a call to the RegisterUIService method of the IDLitUI object:
self->RegisterUIService, 'My UI Service', 'myUIService'