Re: Q: Clearing Widget Events [message #6771 is a reply to message #6764] |
Wed, 14 August 1996 00:00   |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
szoonem@astro.sunysb.edu (Saeid Zoonematkermani) wrote:
>
> Hello,
>
> I am trying to write my first serious widget application and the debugging
> process is confusing me. I am using IDL 4.0.1 on Mac OS.
>
> When some kind of error happens, the widget hangs up and I clear it with
> by pressing the close button. Then I use "WIDGET_CONTROL,/DESTROY,
> EVENT.TOP" and a "RETALL" after that. I return to the main and fix the bug
> and rerun the widget. The widget comes up but accepts no events and is
> totally incative. I have also tried "WIDGET_CONTROL,/CLEAR_EVENTS" and it
> doesn't seem to help. The only solution I have found, is to restart IDL.
> Does any one have any suggestions? Am I missing some thing very basic?
Your use of WIDGET_CONTROL, /DESTROY, /EVENT.TOP doesn't work for
two possible reasons: (1) since the program crashed, XMANAGER is
no longer processing events from this top-level-base, so
WIDGET_CONTROL doesn't work (you would have to issue the
executive command .CONTINUE to do this); and (2) the program may
crash while in some routine other than the event handler, so
EVENT will be undefined.
To clean things up after a crash, I destroy the widgets manually,
and then issue the commands:
retall
xmanager
Actually, I put these commands in a file called "clr", and type:
@clr
I've tried using
WIDGET_CONTROL, /RESET
to destroy all active widgets, but this doesn't seem to clear the
error condition, even if "retall" and "xmanager" are issued afterwards.
The next widget that is created is realized, but then you find yourself
at the IDL> prompt! [Any suggestions here?]
Hope this is useful.
Dave Foster
foster@bial1.ucsd.edu
|
|
|