ITT Rule IDL Version 7.0 用户手册

下载
页码 430
102
Chapter 5: Creating an iTool
Registering a New Tool Class
iTool Developer’s Guide
Example
Suppose you have an iTool class definition file named 
myTool__define.pro
located in a directory included in IDL’s !PATH system variable. Register this class 
with the iTool system with the following command:
ITREGISTER, 'My First Tool', 'myTool'
Tools defined by the 
myTool
 class definition file can now be created by the iTool 
system by specifying the tool name 
My First Tool
. In most cases, this command 
would be included in the launch routine for the 
myTool
 iTool, but the call can be 
placed in any code that is executed before the first instance of the iTool is created.