comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL command line access from inside a widget?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL command line access from inside a widget? [message #82825 is a reply to message #82724] Tue, 15 January 2013 14:28 Go to previous message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
I agree with Matthew here. I've written a few GUIs as objects so that I can do this. For example, I have a GUI which models some images of distant galaxies. One operation that the GUI can do is adjust the contrast of the image using the mouse. But, I've written it such that you can issue a command at the IDL prompt which will set the contrast "manually". Ok, this isn't a particularly good usage of that, but there are other examples within in my code.

If this is sorta like what you want, it's not too hard to implement. But I have it as a procedure (instead of a function like Matthew suggested) and store the object reference as a system variable. So, the "main" code is a ssimple procedure which first checks if the system variable is set, if not then it initializes the GUI and sets the variable. If it is set *AND* the GUI exists (based on what xregistered returns) then it will grab the reference there and issue whatever command you issue --- the commands are issued by keyword settings. When the GUI is killed, I unset the system variable.

Good luck,
Russell



On Friday, January 11, 2013 9:24:11 PM UTC-5, Matthew Argall wrote:
>> If I want to allow the user access to the command line so they can use the rest of IDL to explore the data, what is the best possible way?
>
>>
>
>> I've set NO_BLOCK on the XMANAGER but that puts me back at the MAIN without access to the variables I've loaded inside my procedure.
>
>>
>
>> Is there a way to get back to the command line and have access to the variables I've already loaded?
>
>
>
> What I would do is create an object for your data and write a function to return the object reference. Then, generates your gui and give your object reference as an input.
>
>
>
> When you run your function from the command line, the object reference will be returned to the main level and you will be able to access the properties of your object as well as interact with your GUI.
>
>
>
> Sort of complicated to explain, but I have done it and it is not that bad...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Putting an overbar on text in a plot
Next Topic: Coyote routines no longer included in Astronomy library

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:05:51 PDT 2025

Total time taken to generate the page: 0.75271 seconds