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

General widget programming questions



Hello,

    We have recently started writing some widget based programs in our
IDL programming class and it has gotten me to thinking about a few
issues I would like to better understand before I get too far into our
"final" project.  For starters, I have read the relevant chapters in
Dave Fanning's second edition.  So far, that has been the best help in
understanding widget based programming.  (I have even used some of
Dave's info to correct misinformation presented in class!)

I like the ability to create user defined event structures.  In my
current homework project, I have started using these to pass information
from one widget to another.  I basically pack the information I want to
send to another widget in an event structure and give it a descriptive
name and then send it along to the appropriate widget.  So far, this
seems like a reasonable thing to do.  However, I got to thinking about
potential problems.  First, what happens if other events (i.e. user
generated) are waiting in the queue?  I assume they will get acted on
first and this may or may not cause a problem for the original event
handler which sent an event to a fellow widget.  If this is the case, is
there any way to give a particular event a higher priority over other
events?

If I have say two event handlers called foo1 and foo2, both of which
expect only one positional argument, namely an event, is it possible to
issue a command like this inside of foo2:
   foo1, SomeKindOfEvent
instead of doing this:
   Widget_Control, foo1WidgetID, Send_Event=SomeKindOfEvent
What are the pros and cons of each?  (The biggest difference I see is
that the Handler field of the event would not get filled in by IDL which
brings me to my next question.)

I haven't seen a good example or even an explanation of how and/or why
it would be useful to use the Event.Handler value which is stored in all
event structures.  I thought that I read somewhere in Dave's book that
he was going to address this but, I didn't see any references to using
it in the various chapters on widget programming.  (Dave, am I blind or
did I get confused with something I may have scanned in the IDL online
references?)

As always, I appreciate any and all insight people might have.  Thanks
in advance for advice/answers that come flowing.  Finally, if Dave (or
anyone else) has recommendations for additional high quality
educational/tutorial information that picks up where Dave leaves off in
his book, please let us all know.

Thanks,
Jason Meyers
PhD Student, Center for Imaging Science
Rochester Institute of Technology
jpm7934@cis.rit.edu