[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Phil Aldis writes:

> Can anyone possibly describe exactly how event _funcs work.

Event handler functions work exactly like event handler procedures,
with this exception: they return a value. If that return value
is anything else besides a structure that has ID, TOP, and
HANDLER fields defined as long integers, the return value is ignored
and the event handler function acts *exactly* like an event handler
procedure. But if that return value is a structure with those
fields, the return value is treated as an event structure and it
is passed up the widget hierarchy just as all events are passed.

So you can take an event into a function event handler and either
pass it along untouched by human hands, or you can manipulate the
hell out of it and pass it along as anything your devious heart
desires. For example, I have a colored button compound widget that
is really a draw widget tricked up to *look* like a button. When
the user clicks on the button I take the draw widget event into
my event handler and repackage it to make it *look* like a
button event (heh, heh). The user doesn't know the difference.
They think (ho boy!) that they are using a colored button widget
because they get *button* events from it. :-)



P.S. Did I ever mention that I *love* IDL. :-)

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.