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

Home » Public Forums » archive » Re: IDL app launched from an icon
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 app launched from an icon [message #12993] Mon, 28 September 1998 00:00
hellman is currently offline  hellman
Messages: 4
Registered: September 1998
Junior Member
In article <hellman-2509981817040001@images.ms.nwu.edu>,
hellman@ksan.ms.nwu.edu (Olof Hellman) wrote:

> If you want the user to supply arguments (like an input file) try this:
>
> set inputFile to choose file
> tell application "IDL"
> do script " ignoredResult = anyIDLProcedure( path to inputFile ) "
> end tell
>

Silly me. What you want is:

set inputFile to path to (choose file)
tell application "IDL"
do script " ignoredResult = anyIDLProcedure(inputFile ) "
end tell
Re: IDL app launched from an icon [message #13005 is a reply to message #12993] Sat, 26 September 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Charlie Solomon (crsolomon@west.raytheon.com) writes:

> do you know of a way to allow a user to simply double click on an icon on
> the desktop, which compiles and runs an idl procedure automatically without
> any further effort by the user? in other words, i'd like to make an idl
> procedure act as a separate application. i searched through the help pages,
> but didn't find what i was looking for. thanks in advance for any advice!

I presume this is one a Windows machine. Here is how I do
this on my WindowsNT machine.

1. I write a "main" program that calls my application
program. Suppose I want to run my XSurface program on
my web page. The Main program is written like this:

PRO Main
XSurface
END

2. Open a *new* IDL session and type these commands:

IDL> .Compile Main
IDL> Resolve_All

Since this is a program that uses objects, I must also
explicitly compile all of my 'object'__define.pro files,
since Resolve_All doesn't think about these files:

IDL> .Compile Trackball__Define

3. Save all the compiled modules in a "save" file:

IDL> Save, /Routines, Filename='main.sav'

4. Exit IDL.

5. If I just want to run the XSurface application, I can
now just double-click the main.sav program name with
my mouse. If you have difficulty with this step it may
be because the *.sav file extension is not associated
with the run-time version of IDL in the registry. If it
is not, open the NT Explorer application, find the
View|Options menu, go to the File Types tab, and make
sure the association is set up correctly. (I believe,
although I am not sure, that in Windows 95 the File
Types association may be accessed from a Control Panel
program rather from the File Manager. See your Windows
95 documentation.)

6. If I want to make this file have a different icon (I.e.,
an "application" icon), I make a shortcut to the main.sav
file. Then I right-click on the shortcut, select the
Properties menu item, select the Shortcut tab, and click
the Change Icon button to select an icon more indicative
of my application. I probably also give the shortcut a
really nifty name, like "PowerVis" or something. :-)

7. When I run the application, I just see my widget program
running. There is no evidence of IDL at all.

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: IDL app launched from an icon [message #13007 is a reply to message #13005] Sat, 26 September 1998 00:00 Go to previous message
krieger is currently offline  krieger
Messages: 7
Registered: June 1997
Junior Member
In article <6uh076$7oc@hacgate2.hac.com>, "Charlie Solomon" <crsolomon@west.raytheon.com> wrote:
> Can someone help with this?...

> do you know of a way to allow a user to simply double click on an icon on
> the desktop, which compiles and runs an idl procedure automatically without
> any further effort by the user? in other words, i'd like to make an idl
> procedure act as a separate application. i searched through the help pages,
> but didn't find what i was looking for. thanks in advance for any advice!

For Windows, create a link to IDL on your desktop (simply copy the IDL
icon from the start menu folder to the desktop folder).

Write a short IDL script "startapp" to start your program:

==================

cd, "appdir" ; needed because IDL 5.1 doesn't recognize the working
; directory in the link property sheet anymore
restore, "myapp.sav"

myapp ; the main routine of your application

exit

==================

In the link property sheet modify the "Target" slot, e.g.:

C:\Rsi\Idl51\Idlde.exe @appdir\startapp

In the "startapp" script you could also, instead of restoring the
precompiled application, directly run the compilation itself.

Simply replace the line with the restore command by

compile myapp1.pro
compile myapp2.pro
etc. pp.

Hope that helps.

Karl

--
Disclaimer: I do not speak for the IPP despite my mouth is big enough.
Re: IDL app launched from an icon [message #13011 is a reply to message #13005] Fri, 25 September 1998 00:00 Go to previous message
hellman is currently offline  hellman
Messages: 4
Registered: September 1998
Junior Member
This is easy on MacOS. Write an AppleScript that looks like:

tell application "IDL"
do script " ignoredResult = anyIDLProcedure() "
end tell

compile and save as an application. You are done.
If you want the user to supply arguments (like an input file) try this:

set inputFile to choose file
tell application "IDL"
do script " ignoredResult = anyIDLProcedure( path to inputFile ) "
end tell

If you are not using a Mac, God help you.

- Olof

>
> do you know of a way to allow a user to simply double click on an icon on
> the desktop, which compiles and runs an idl procedure automatically without
> any further effort by the user?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Tab between fields
Next Topic: Re: Contributed Source: CW_selectaxes (Corrected and working!)

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

Current Time: Wed Oct 08 19:33:16 PDT 2025

Total time taken to generate the page: 0.00683 seconds