Re: Q:IDL X windows error [message #12652] |
Mon, 10 August 1998 00:00  |
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
|
|
|