Leaving XMANAGER [message #46733] |
Mon, 12 December 2005 09:40 |
James Everton
Messages: 19 Registered: November 2005
|
Junior Member |
|
|
Hello everybody,
Hope your holidays are all going well. Lucky for me, mine can't
actually start until I get some IDL programming done, so here I am
asking for a little help.
I'm writing a function at the moment that uses widgets, and since I'm
still learning my way around IDL, I'm using XMANAGER at the moment to
handle all of my events. However, in my widgets, I have a button that,
once pushed, needs to have the main function exit and return a 1,
whereas if they hadn't pushed the button and had closed the program, it
would return a -1.
The problem I'm having is that when I enter XMANAGER after the button
gets pushed, I can close down the widget using:
> WIDGET_CONTROL, event.top, /DESTROY
however, I can't find a way to have a variable passed back to the main
function that originally called XMANAGER, so that I can return from
there with a 1.
I tried attaching a variable to the uvalue of my button and modifying
that in the XMANAGER event, but I soon found out that when I destroy
the widget hierarchy in my event handler, I can't use the button's
uvalue because (*gasp*) it got destroyed already.
Is there some way to pass a variable to XMANAGER outside of the widget
hierarchy, or maybe have XMANAGER somehow return out of my function
with the 1 that I want it to?
Thanks very much for reading my little problem.
Sincerely,
James
|
|
|