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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL command line access from inside a widget? [message #82722] Fri, 11 January 2013 19:02 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Matthew Argall writes:

> 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...

This is not a bad idea, since you at least have some kind of control
over what the user can do with the data through the object interface.
Giving the user carte blanche, even if it were possible (it's not), is a
recipe for complete and utter disaster. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: IDL command line access from inside a widget? [message #82724 is a reply to message #82722] Fri, 11 January 2013 18:24 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> 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...
Re: IDL command line access from inside a widget? [message #82725 is a reply to message #82724] Fri, 11 January 2013 18:09 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian Cherinka writes:

> I forgot to mention that the user should be able to manipulate the data in IDL but still be able to interactively use the widget at the same time.

You know what would be cool? If, while the user was at it,
he could run MatLab and R programs, too. ;-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: IDL command line access from inside a widget? [message #82727 is a reply to message #82725] Fri, 11 January 2013 17:23 Go to previous messageGo to next message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
I forgot to mention that the user should be able to manipulate the data in IDL but still be able to interactively use the widget at the same time.


On Friday, January 11, 2013 7:51:37 PM UTC-5, Brian Cherinka wrote:
> I have a widget program that I'm running that displays some data and allows the user some interaction.
>
>
>
> 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?
>
>
>
> Is the answer to spawn an instance of IDL at the end of my widget procedure that runs a specified script to give me the variables I want?
>
>
>
> On a side note, is it possible to spawn a new xterminal, open idl in it and run a script, all from within IDL? I've spawned the xterminal but can't get idl to load in it.
>
>
>
> Thanks for the help.
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...
  Switch to threaded view of this topic Create a new topic Submit Reply
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 11:36:58 PDT 2025

Total time taken to generate the page: 0.00723 seconds