Re: Open URL in external browser [message #69831 is a reply to message #69829] |
Wed, 17 February 2010 15:13   |
Rob[2]
Messages: 11 Registered: May 2007
|
Junior Member |
|
|
On Feb 17, 1:38 pm, mgalloy <mgal...@gmail.com> wrote:
> On 2/17/10 11:37 AM, Rob wrote:
>
>
>
>
>
>> On Feb 17, 11:22 am, mgalloy<mgal...@gmail.com> wrote:
>>> On 2/17/10 11:13 AM, Rob wrote:
>
>>>> Is there a native IDL method for opening a URL (e.g.
>>>> http://spidr.ngdc.noaa.gov/spidr/servlet/GetMetadata?param=i ono.WI937)
>>>> in a browser? I'm not looking for a "spawn" like executive solution.
>>>> I'm building a tool that must work on many OS's including OSx,
>>>> Windows, possibly Linux.
>
>>>> I looked into the "online_help" procedure which seems to work only for
>>>> local (a la file://) content.
>
>>> Here's my solution:
>
>>> http://michaelgalloy.com/wp-content/uploads/2010/02/mg_open_ url.pro
>
>>> It is a "spawn" solution, but has separate cases for the different
>>> operating systems. Mac OS X and Windows have nice (though different)
>>> ways to open the default web browser on the URL. On other Unix systems,
>>> a file dialog will come up to select your web browser. It will remember
>>> your choice, so you only have to choose once (I suppose I should add a
>>> keyword to force the choice so that you can change your mind later).
>
>>> Mike
>>> --www.michaelgalloy.com
>>> Research Mathematician
>>> Tech-X Corporation
>
>> Awesome, thanks! I'm going to use this next week at the IDL/LASP
>> workshop.
>
> Cool, at the IDL User Group meeting at LASP? I will be there as well.
>
> Mike
> --www.michaelgalloy.com
> Research Mathematician
> Tech-X Corporation
Yes, I'm giving:
IDL driven Space Physics Modeling and Investigations
See you there!
Another suggested solution from a friend to my "open url in browser
query" is given as:
oJavaDesktop = OBJ_NEW('IDLJavaObject$Static$JAVA_AWT_DESKTOP',
'java.awt.Desktop')
oJavaURI = OBJ_NEW('IDLJavaObject$JAVA_NET_URI', 'java.net.URI',
'http://www.cnn.com/')
if (oJavaDesktop->isDesktopSupported()) then begin
oBrowser = oJavaDesktop->getDesktop();
oBrowser->browse,oJavaURI
OBJ_DESTROY, oBrowser
endif
;Remove Objects
OBJ_DESTROY, oJavaURI, oJavaDesktop
|
|
|