|
Re: Leaving XMANAGER [message #46732 is a reply to message #46731] |
Mon, 12 December 2005 09:49  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James Everton writes:
> 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?
Pointers. :-)
You want to read this article:
http://www.dfanning.com/widget_tips/widget_tips/popup.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|