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

Home » Public Forums » archive » Re: Is my terminal an X-device from IDL?
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: Is my terminal an X-device from IDL? [message #1646] Tue, 04 January 1994 10:29
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
sjt@xun8.sr.bham.ac.uk (James Tappin) writes:

> Is there any way (other than waiting for the error message on trying to open a
> window or a widget) to tell from within IDL whether the user is using an
> X-terminal or workstation.

> The particular problem I have in mind is a piece of software which can be run
> either from widgets or via a command line interface, with the widget interface
> to start up if possible. This works nicely by using the !D.FLAGS to check if
> widgets are available for the current device, but I haven't been able to find
> a way (suitable for unsophisticated users) to check whether the X-device can
> be opened.

> --
> James Tappin, School of Physics & Space Research
> University of Birmingham

In Unix you should be able to check for a nonempty environment variable
DISPLAY. The VMS equivalent seems to be DECW$DISPLAY. Therefore, something
like the following should work:

IF !VERSION.OS EQ 'vms' THEN ENV = 'DECW$DISPLAY' ELSE ENV = 'DISPLAY'
IF STRLEN(GETENV(ENV)) NE 0 THEN ... ;Have X-windows

One could add a few more IF statements to take care of IDL for Windows and IDL
for MacIntosh which always have windows/widgets, even though not X-windows.

Bill Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Change in behavior of string constants?
Next Topic: (?) IDL as remote data browser

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

Current Time: Thu Oct 09 23:47:20 PDT 2025

Total time taken to generate the page: 0.31686 seconds