
Chapter 13: Creating a User Interface Service 301
iTool Developer’s Guide Creating a New UI Service
Place data collected by the user interface in the function’s return value
Create your user interface routine (the routine that creates the IDL widgets that make
up the user interface displayed by your UI service) as a function, returning the data
values collected by the interface in the function’s return value. If you are collecting
several values of different data types, return a structure variable containing the data.
The user interface and event-handling code should never change data or property
values within the iTool itself; all changes should be made via the SetProperty
mechanism.
Be sure to clean up heap variables when the user interface exits
If your user interface code creates pointer or object heap variables, be sure to destroy
them before the interface code exits. If extra “hanging” heap variables are left
undestroyed, IDL can potentially run out of resources if the interface is displayed
numerous times.
Use the GROUP_LEADER property if it is available
Pass the widget ID contained in the GROUP_LEADER property of the IDLitUI
object to your user interface code, and set the GROUP_LEADER keyword of the top-
level base widget to this value. Setting the widget group leader to the leader of the
iTool’s own widget hierarchy ensures that your user interface will be destroyed if the
iTool itself is destroyed.