Re: A TRACKING_EVENT MYSTERY (was widget_event mystery) [message #8254] |
Fri, 21 February 1997 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
JD Smith <jdsmith@astrosun.tn.cornell.edu> writes:
> I have narrowed the problem. Widget_event is crashing on
> TRACKING_EVENTS. I have used these in the past with no problems. Here
> is a very simple way I generated the error:
>
> pro test_event,ev
> help,ev,/st
> return
> end
>
> pro test
> b=widget_base(/TRACKING_EVENTS,xsize=5,ysize=5)
> for i=0,100 do begin
> print,'prior to event call'
> a=widget_event(b) ; <---- crashes here on first time around
> print,'after event call'
> help,a,/st
> endfor
> end
This code worked on my Mac (after I added a line to realize the
base widget, which I assume was inadvertently left out of the
code).
I don't know what might be happening here, but
there is a *very* strange widget bug in IDL that can cause
you to think your machine has been taken over by spirits of
the underworld. I see it often when I am creating "pseudo"
widget events. As soon as you touch a widget, you crash
in XManager with an "Array diminsions must be greater
than zero" message.
It has to do with defining event structures yourself
in event handlers. You may be doing this here because from
this code fragment it looks like you prefer to do things the hard
way (i.e., manage events yourself instead of letting
XManager do it).
The insidious thing about this bug is when it
manifests itself. If a widget program is run in the
IDL session *before* you run the widget program
that tickles this bug, you see nothing wrong with
your program. If you run the bug tickling program
*first* then every widget you touch fails! I once
spent three hellish weeks reinstalling software,
checking for viruses, and praying fervently before
I discovered the source of this strange behavior.
I hear it is fixed in IDL 5.0.
Now I avoid the problem by declaring my pseudo event structures
in my widget definition module instead of in my
event handlers. For some reason, this makes IDL happy.
It's simpler than sacrificing virgins, which is what I
was going to try next. :-)
Cheers!
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
|
|
|