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

Home » Public Forums » archive » Re: Private vs. shared colormaps in 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: Private vs. shared colormaps in IDL [message #10963] Fri, 30 January 1998 00:00
bennetsc is currently offline  bennetsc
Messages: 18
Registered: January 1998
Junior Member
In article <MPG.f3ac8502ddbd6f989705@news.frii.com>,
David Fanning <davidf@dfanning.com> wrote:
> Scott Bennett (bennetsc@ucs.orst.edu) writes:
>
>> I'm an IDL novice and need a bit of help. I'm running IDL 5
>> on a Sun under Solaris 2.5.x and using an HP 735 running HP-UX 9
>> as the DISPLAY. My problem is that I need idl to use shared color
>> maps. Right now if I do a plot, for example, idl loads a private
>> color table, which conceals nearly everything on the screen except
>> the plot itself, even the window frame. That means I'm fishing in
>> the dark just to find the button on the frame to change the window
>> to an icon in order to reactivate the shared map used by all other
>> applications and the window manager. I have also tried it using
>> the Sun as the DISPLAY with the same results.
>
> By default, IDL always grabs all of the colors that remain
> in the shared color map for itself. It will only be given
> a private color map if there are no colors remaining in the
> shared color map. (Or, more precisely, IDL will be assigned
> a private color map if it asks for more colors than can be
> provided in the shared color map.)

Okay, thanks for that tidbit, which does not appear to be
documented in the IDL manuals.
>
> Clearly, the technical problem you are experiencing is known
> in the trade as "ain't no colors left". :-)
>
> The question is, why?
>
> I'll hazard a guess or two. Both the Solaris and HP operating
> systems use the Common Desktop Environment (CDE), and boy,
> does that splash screen look great! Unfortunately, it uses
> about 100 colors to get that great effect. Assign another
> 10 colors or so to the window manager, and that leaves the
> rest of the applications looking to share about 146 colors.
> Almost too few for real scientific programming.
>
To save time and space here, I'm going to skip quite a
bit of David's speculation because his description doesn't
match what is happening.
First off, when I started using IDL 5 several months ago
on the configuration I described, I did have a problem with
IDL and the color allocation. I use idlde a lot, though the
current problem does not depend upon idlde; i.e. the current
problem occurs with idl, regardless of whether it is started
by me or by idlde. Anyway, the problem I had long ago was
taken care of nicely by aliasing idlde to "idlde -colors -150"
in my .cshrc stuff. That worked just fine until a week or two
ago and I haven't discovered yet what has changed. During
those months I sometimes simultaneously ran Mathematica on yet
another system with its DISPLAY set to the HP and Netscape
locally on the HP with the DISPLAY set to the HP. Worked fine.
Now it doesn't work fine. Since receiving David's reply,
I've tried changing HP VUE's color stuff, which I did not have
to do in the past. I've tried "default," which is what I've
had it set to all along, "high color," "medium color," "low
color," and "black and white." None of them stopped IDL from
replacing the current color map, leaving me hunting around on
a black screen trying to find the button to iconify the offen-
ding window to get the system's color map back, so I could see
what I was doing again. I did these little experiments with
only VUE and some xterm's running to compete with IDL for
colors. (At least one xterm was required in order to log into
the Sun to run idl or idlde. xterm only needs two colors and
all the xterm's use the same two colors.)

> You can find a number of other articles about color and IDL
> on my web page. I'm currently working on an article about how

Thanks. I'll take a look soon.

> to get IDL and an application like NetScape to share the
> *same* set of colors in the shared color map.
>
> There are other things that could be going on here, too.
> This is not the only scenario. Only the most likely,
> in my experience. Another possibility is that someone put
> the selection of IDL colors in the .Xdefaults file and you simply
> don't have that number of colors in your shared map when you start IDL.

Well, there wasn't any .Xdefaults file until I started mucking
around trying to fix the problem, so that isn't it either. And what
I put into it was:

idl.colors: -150
Idl*colors: -150

According to the manual, those are overridden by -colors n on the
command line, which I also tried setting to various negative and
positive numbers. Nothing made the slightest bit of difference that
I could see.

> If you want to call me while you are in front of the machine we could
> probably sort it out in a couple of minutes.
>
I may do that. Thanks for the offer and thanks much for the
help so far.


Scott Bennett, Comm. ASMELG, CFIAG
Dept. of Atmospheric Sciences
Oregon State University
Corvallis, Oregon 97331
************************************************************ **********
* Internet: sbennett@ats.orst.edu sbennett@oce.orst.edu *
*----------------------------------------------------------- ---------*
* "The jury has a right to judge both the law as well as the fact in *
* controversy."--John Jay, First Chief Justice, U.S. Supreme Court *
* in Georgia vs. Brailsford, 1794 *
************************************************************ **********
Re: Private vs. shared colormaps in IDL [message #10964 is a reply to message #10963] Thu, 29 January 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Scott Bennett (bennetsc@ucs.orst.edu) writes:

> I'm an IDL novice and need a bit of help. I'm running IDL 5
> on a Sun under Solaris 2.5.x and using an HP 735 running HP-UX 9
> as the DISPLAY. My problem is that I need idl to use shared color
> maps. Right now if I do a plot, for example, idl loads a private
> color table, which conceals nearly everything on the screen except
> the plot itself, even the window frame. That means I'm fishing in
> the dark just to find the button on the frame to change the window
> to an icon in order to reactivate the shared map used by all other
> applications and the window manager. I have also tried it using
> the Sun as the DISPLAY with the same results.

By default, IDL always grabs all of the colors that remain
in the shared color map for itself. It will only be given
a private color map if there are no colors remaining in the
shared color map. (Or, more precisely, IDL will be assigned
a private color map if it asks for more colors than can be
provided in the shared color map.)

Clearly, the technical problem you are experiencing is known
in the trade as "ain't no colors left". :-)

The question is, why?

I'll hazard a guess or two. Both the Solaris and HP operating
systems use the Common Desktop Environment (CDE), and boy,
does that splash screen look great! Unfortunately, it uses
about 100 colors to get that great effect. Assign another
10 colors or so to the window manager, and that leaves the
rest of the applications looking to share about 146 colors.
Almost too few for real scientific programming.

But if you are like me, you don't grab your cup of coffee
and immediately start knocking out beautiful widget programs
first thing in the morning. You have to kind of ease into it.
I like to read my mail. Knock off another 10 colors for the
e-mail application. Then I usual see if the Germans have left
any interesting messages on the IDL newsgroup overnight. That
takes another 20 or so colors for the news reader. Inevitably
someone references some neat new web page that I haven't looked
at yet and I fire up the ol' browser.

Whoops. All my colors are gone. Because NetScape acts sort of
like IDL and thinks its the king of the roost. It grabbed all
the colors remaining in the shared color map.

My the time I get around to doing a little IDL programming and
justifying the brand new computer, there are no colors left in
the shared color map and I get a private color map.

What could I have done about it?

Well, I could have read the CDE documentation and figured out
how to set the CDE to use a "medium" or "low" number of colors.
That would help.

I could have started IDL up before I started all those other
applications. (But I better learn how to do it in such a way
that all those other applications don't hate me!)

I could also read the NetScape documentation to tell it to
use some specific number of colors (25 seems about right to
me).

Suppose I want to start IDL up before all the other applications,
but I want to leave some colors in the shared color table for
them to use. I could start IDL up and then open the very first
graphics window (this is when the number of colors in that
IDL session is determined) like this:

Window, Colors=-30

Now IDL has taken all but 30 colors from the shared color map.
Those 30 remaining colors can be fought over by the other
applications.

You can find a number of other articles about color and IDL
on my web page. I'm currently working on an article about how
to get IDL and an application like NetScape to share the
*same* set of colors in the shared color map.

There are other things that could be going on here, too.
This is not the only scenario. Only the most likely,
in my experience. Another possibility is that someone put
the selection of IDL colors in the .Xdefaults file and you simply
don't have that number of colors in your shared map when you start IDL.
If you want to call me while you are in front of the machine we could
probably sort it out in a couple of minutes.

Cheers,

David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Q: debuggging widget applications in IDL 5
Next Topic: Cross-correlating images

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

Current Time: Wed Oct 08 14:52:27 PDT 2025

Total time taken to generate the page: 0.00547 seconds