Re: Event generation by object. [message #17681 is a reply to message #17678] |
Wed, 10 November 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Erik (ehummel@best.ms.philips.com) writes:
> Suppose an objectData which contains some data. Another objectOther is
> interested in this objectData.
> I like to have the following situation:
> The data of objectData is modified. This objectData generates an event
> on this modification. The event
> can be received by objectOther if this objectOther has subscribed on
> notifications of objectData.
> Both these objects don't have widgets.
> Question: is there an event mechanism in IDL which makes this possible?
If by "subscribed" you mean it was given an object reference
and the name of a method to call, then yes, you can do
it like this, where "newdata" is any arbitrary parameter
or parameters accepted by the method:
IF Obj_Valid(objReference) THEN $
Call_Method, objReference, objMethod, newdata
For some reason I can't find Call_Method in the
documentation (at least by going through the Index
of the On-Line help), but I know it is there and
that it works because I use it a lot. :-)
Cheers,
David
P.S. See the NotifyObj keyword in my XCOLORS program if
you want an example of how an object "subscribes" for
notification.
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|