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

Home » Public Forums » archive » Re: Q:IDL X windows error
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: Q:IDL X windows error [message #12652] Mon, 10 August 1998 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Rick Towler wrote:
> I am running IDL v5.1 on HP-UX 10.2 at a screen depth of 8bpp and am
> accessing it from a RedHat linux 5.1 box running at a screen depth of
> 16bpp.
>
> From within IDL I can not output anything do device "x" without
> receiving the following error:
>
> % Unsupported X Windows visual (class: StaticGray, depth: 0).
> Substituting default (class: <UndefinedVisual>, Depth: 0).
> % Execution halted at: $MAIN$
>
> Does anyone have any experience with this error? I am guessing it stems
> from the fact that locally I am at 16bpp while the remote machine can
> only generate 8bpp. The easy answer would be to operate at 8bpp locally
> but this is unacceptable since it will generate problems with other
> applications. Is there another work-around?

Rick,

The situation with 16 bit color is explained in detail at
http://www.rsinc.com/tipoweek/archive/color3.html

I've found the attached routine to be very useful in selecting an
appropriate visual at IDL startup. I have the following as the first
line in my startup file:

colorset, retain=2, decomposed=0

You may wish to use retain=0 if you use object graphics. My only other
advice is to get rid of any IDL visual or color resource settings in
your .Xdefaults file, and use the routine below instead.

Cheers,
Liam.

PRO COLORSET, RETAIN = RETAIN, DECOMPOSED = DECOMPOSED

;+
; NAME:
; COLORSET
;
; PURPOSE:
; Select true color (24 bit) if available or pseudo color (8 bit)
visual
; consistently on X, Windows, and Macintosh.
;
; CATEGORY:
; Startup utilities.
;
; CALLING SEQUENCE:
; COLORSET
;
; INPUTS:
; None
;
; OPTIONAL INPUTS:
; None
;
; KEYWORD PARAMETERS:
; RETAIN Specifies the default method used
; for backing store when creating new windows.
; 0 => No backing store
; 1 => Server or window system performs backing store
(DEFAULT)
; 2 => Make IDL perform backing store
; DECOMPOSED Specifies the the way in which graphics
; color index values are interpreted when using
displays with
; decomposed color (TrueColor or DirectColor visuals).
; 0 = > Color indices given by single 8 bit values
(DEFAULT)
; 1 = > Color indices given by three 8 bit values
;
; OUTPUTS:
; None
;
; OPTIONAL OUTPUTS:
; None
;
; COMMON BLOCKS:
; None
;
; SIDE EFFECTS:
; This routine changes the IDL visual for the rest of the IDL
session.
;
; RESTRICTIONS:
; Only affects X, WIN, and MAC displays.
; Only has an effect if run before any windows have been
; created, and if no DEVICE commands have been executed.
;
; EXAMPLE:
;;Execute the following command immediately after IDL startup (no
startup file)
;colorset
;
; MODIFICATION HISTORY:
; Written by: Liam.Gumley@ssec.wisc.edu
;
; $Id: colorset.pro,v 1.1 1998/06/17 19:37:17 gumley Exp $
; $Log: colorset.pro,v $
; Revision 1.1 1998/06/17 19:37:17 gumley
; Initial version
;
;-

;- Check keywords

if n_elements( retain ) ne 1 then retain = 1
retain = ( retain > 0 ) < 2
if n_elements( decomposed ) ne 1 then decomposed = 0
decomposed = ( decomposed > 0 ) < 1

;- Windows case (visual cannot be changed)

if !d.name eq 'WIN' then $
device, decomposed = decomposed, retain = retain

;- X and Macintosh case (will revert to 8 bit visual if 24 bit fails)

if !d.name eq 'X' or !d.name eq 'MAC' then $
device, true_color = 24, decomposed = decomposed, retain = retain

END
Re: Q:IDL X windows error [message #12655 is a reply to message #12652] Mon, 10 August 1998 00:00 Go to previous message
Kevin Ivory is currently offline  Kevin Ivory
Messages: 71
Registered: January 1997
Member
Rick Towler wrote:
> I am running IDL v5.1 on HP-UX 10.2 at a screen depth of 8bpp and am
> accessing it from a RedHat linux 5.1 box running at a screen depth of
> 16bpp.
>
> From within IDL I can not output anything do device "x" without
> receiving the following error:
>
> % Unsupported X Windows visual (class: StaticGray, depth: 0).
> Substituting default (class: <UndefinedVisual>, Depth: 0).
> % Execution halted at: $MAIN$
>
> Does anyone have any experience with this error? I am guessing it stems
> from the fact that locally I am at 16bpp while the remote machine can
> only generate 8bpp. The easy answer would be to operate at 8bpp locally
> but this is unacceptable since it will generate problems with other

I think IDL does not support 16 bpp in any Unix version, so you will
definitely have to change to 8 bpp (with all color flashing problems
etc.) or to 24 bpp. With most graphics cards & resolutions, if you can
use 16 bpp, you can use 24 bpp as well. I use 16 bpp per default
(because my 24 bpp X server has many bugs) - and when I need IDL graphics,
I open another virtual terminal with 24 bpp with a command like
(this is for Linux):
X -query localhost -bpp 24 :1

IDL not supporting 16 bpp is *almost* a reason to dump it.

Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin.Ivory@linmpi.mpg.de
D-37191 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Revision Control
Next Topic: Re: On-line documentation for changes between 4.0 and 5.0?

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

Current Time: Fri Oct 10 00:29:00 PDT 2025

Total time taken to generate the page: 0.23843 seconds