Re: Widget color tables [message #14649 is a reply to message #14643] |
Mon, 15 March 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
throop@colorado.edu wrote:
> I'm having problems setting the color table properly in a widget
> program. IDL 5.2, sparc ultra, 8-bit display. Here's the situation:
> o The problem is that the loadct command appears to be completely
> ignored; the color table is just not set, or at least not displayed.
> Instead, my default desktop color table is used. help, /device tells
> me that indeed a 100-element private color map is assigned.
> o I've found that if, before or after the widget is realized,
> I create a non-widget window:
> and move the cursor _into that window_, the color table for the widget
> will be properly displayed and updated, as long as the cursor's in
> that window. It appears that idl may be setting the color table
> properly, but only displaying it when the cursor is in a draw window,
> and not when the cursor's in a widget window.
> | Henry Throop throop@colorado.edu (303) 492-1628 |
> | Laboratory for Atmospheric and Space Physics |
> | University of Colorado, Boulder 80309-0392 |
The following IDL startup file should be an effective cure for this
problem:
;---cut here---
;- Set up 8 bit display and grab colors
if !version.os_family eq 'unix' then device, pseudo = 8
device, retain = 2, decomposed = 0
window, /free, /pixmap, colors = -5
plot, [ 0 ]
wdelete, !d.window
print, 'Number of colors is ', !d.n_colors
;- Set graphics and widget font sizes
device, set_character_size = [ 6, 9 ]
widget_control, default_font = '7x13'
;- ensure IDL 5.0 XMANAGER behavior is consistent with IDL 4.0
xmanager, catch = 0
;---cut here---
Just set the environment variable IDL_STARTUP to the full name and path
of the startup file. It will then be executed every time you start IDL.
Cheers,
Liam.
PS Didn't IDL get started at LASP way back when?
---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
1225 W. Dayton St., Madison WI 53706, USA
Phone (608) 265-5358, Fax (608) 262-5974
http://cimss.ssec.wisc.edu/~gumley
|
|
|