user manual

Chapter 7: Creating an Operation 155
iTool Developer’s Guide Creating a New Data-Centric Operation
call the Init methods of any superclasses, using the keyword inheritance
mechanism to pass “extra” keywords
register any properties of the operation, and set property attributes as necessary
perform other initialization steps as necessary
return the value 1 if the initialization steps are successful, or 0 otherwise
Definition of the Init Function
Begin by defining the argument and keyword list for your Init method. The argument
and keyword list defines positional parameters (arguments) accepted by your method,
defines any keywords that will be handled directly by your method, and specifies
whether keywords not explicitly handled by your method will be passed through to
other routines called by your method via IDLs keyword inheritance mechanism.
Note
Because iTool operations are invoked by the user’s interactive choice of an item
from a menu, they generally do not accept any keywords of their own.
The function signature of an Init method for an operation generally looks something
like this:
FUNCTION
MyOperation
::Init, _REF_EXTRA = _extra
where MyOperation is the name of your operation class.
Note
Always use keyword inheritance (the _REF_EXTRA keyword) to pass keyword
parameters through to any called routines. (See Keyword Inheritance (Chapter 5,
Application Programming) for details on IDLs keyword inheritance mechanism.)
Superclass Initialization
The operation class Init method should call the Init method of any required
superclass. For example, if your operation class is based on an existing operation, you
would call that operation’s Init method:
success = self->
SomeOperationClass
::Init(_EXTRA = _extra)
where SomeOperationClass is the class definition file for the operation on which
your new operation is based. The variable
success contains a 1 if the initialization
was successful.