Re: Private vs. shared colormaps in IDL [message #10964 is a reply to message #10963] |
Thu, 29 January 1998 00:00  |
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/
|
|
|