IDL Runtime [message #27930] |
Tue, 13 November 2001 22:15  |
Andre Kyme
Messages: 19 Registered: September 2001
|
Junior Member |
|
|
Hi,
I've developed a widget program which must now be run on IDL runtime.
Problem is that whenever a "Cancel" button is selected (which
should return execution to the initial menu options) the entire program
exits and IDL too! Does anyone know why this is? I'm using the RETALL
command in the program to return to the top level (which is XMANAGING
the menu) when "cancel" is pressed. It seems to be working fine with
the normal development license??
Thanks,
Andre Kyme
|
|
|
Re: IDL Runtime [message #28002 is a reply to message #27930] |
Wed, 14 November 2001 14:22   |
Andre Kyme
Messages: 19 Registered: September 2001
|
Junior Member |
|
|
Hi again,
Thanks for the replies re RUNTIME and RETALL.
I wasn't aware that retall was solely a debugging tool. But I'll only use
it as such from now on...
Perhaps my problem is some confusion relating to how XMANAGER works. As
far as I can understand if I create a bunch of buttons under a TL base,
then call XMANAGER, the program is 'hung' in a loop checking whether
events are being processed. So far OK? If one of the buttons is clicked,
then we jump to the event handler for that button; but suppose that the
event handler calls an event-processing routine that calls another, that
calls another etc. - so we end up a few levels deep in the processing of
the event. I have used modal prompts along the way in this event
processing so that the user can decide "Yes" "No" "Maybe" and so on. One
option I want to give them is "Cancel back to the bunch of buttons."
Retall seemed a useful way of getting back to main program level, which am
I right in saying will enter us back into the XMANAGER loop ready for the
next event?? David says, "Try a more conventional way than using retall" -
what is the conventional way of returning from deep in event-processing
programs back to the menu buttons? There are no widgets to destroy, I just
want to get back to the state the application was in when first loaded.
Thanks,
Andre Kyme
|
|
|
Re: IDL Runtime [message #28020 is a reply to message #27930] |
Wed, 14 November 2001 07:03   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Andre Kyme <nak@imag.wsahs.nsw.gov.au> writes:
>
> I've developed a widget program which must now be run on IDL runtime.
> Problem is that whenever a "Cancel" button is selected (which
> should return execution to the initial menu options) the entire program
> exits and IDL too! Does anyone know why this is? I'm using the RETALL
> command in the program to return to the top level (which is XMANAGING
> the menu) when "cancel" is pressed. It seems to be working fine with
> the normal development license??
This is a "doctor, it hurts when I do this" type of question. (Doctor:
"Then don't do that.")
I would argue that the only use for the RETALL command is in
interactive debugging of programs, and it should never be used in
production programs. As you have just pointed out, RETALL takes away
all of your control of the program flow. In your specific case, a
return to the main level apparently causes the runtime to exit. There
are well established means to return from a widget, like
"WIDGET_DESTROY" followed by RETURN.
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: IDL Runtime [message #28059 is a reply to message #27930] |
Thu, 15 November 2001 09:46  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Oh, what a sweet thread. Too bad I missed it. IDL took over my laptop
yesterday, I even managed to heat the CPU to the point the fan went on,
all using #. But David handled the issue as he always does - with
knowledge and determination that are to be admired :)
Cheers,
Pavel
|
|
|