comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Classes and Widget Event Handlers...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Classes and Widget Event Handlers... [message #16227 is a reply to message #16131] Sat, 03 July 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Struan Gray (struan.gray@sljus.lu.se) writes:

> When this was originally posted in June '97, Ronn Kling and Bob
> Mallozzi pointed out you could exploit the way that IDL calls and
> defines event handlers. Ronn Kling used the EVENT_PRO keyword when creating
> the top level base to define EXAMPLE::EVENT as an event procedure.

I don't recall now if Ronn actually did this or not, but
if he did it was a BAD idea! Using the EVENT_PRO keyword
to assign the event handler to the top-level base can result
in all kinds of havoc. This event handler should *always* be
assigned with the Event_Handler keyword on the XManager
routine. (By the way, I am explicitly talking about a
top-level base that is being *managed* by XManager.)

> Both techniques look powerful (and, more importantly, cool :-),
> but both seem to rely on the ability to invoke an object method as if
> it were a normal procedure, something that should, formally, be
> impossible.

I think it is impossible (or, more accurately, I haven't
discovered a way to do it). But, by putting the "self"
structure in the user value of the top-level base, each
event handler has access to the self object pretty much
directly. True, you have to interact with it through
methods, but for most programs these methods are super
simple to write. Certainly easier, most of the time,
than writing the requisite event handler code.

Cheers,

David
--
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Classes and Widget Event Handlers...
Next Topic: GET_DRAW_VIEW question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Tue Dec 02 10:28:43 PST 2025

Total time taken to generate the page: 0.23876 seconds