[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colormaps (a favorite subject!)


I've been away from this newsgroup for a LONG time, so I'm sorry that my
answer is 3 months out of date.  I'm sure you've solved the problem by
now, one way or another.  However, one possibility that wasn't mentioned
is to provide your users with a command-line option on startup to allow
them to set this value.  It's not as convenient to change as a pop-up
(when you don't want the default), but it's actually less intrusive for
those who do want the default.

If it's an issue of certain users wanting it, they probably won't mind
having to say something like your_app, ncol=64, especially if they can
set up a script to do this the way they want, and that's a one-time


Craig Hamilton wrote:
> Hi all:
> I've run into a little snag dealing with colormaps and thought I would seek
> the advice of the wise ones.
>  I have an image-viewing program that displays gray-level images.
> Works great.  I had this idea that I wanted to make some
> of settings user-selectable on startup, so I first popped up a window with
> some radio buttons in it.  One set of radio buttons lets the user select
> the number of gray-levels used in the colormap.
> The problem is that IDL requires something like:
>     window,0,colors=numcolors,/pixmap,xsize=10,ysize=10
>    wdelete,0
> to initially setup the colormap, prior to any windows being created.
> But, I have already created my popup window. So it seems to me
> I'm in a catch-22:  I have to specify the number of colors before I
> create my popup window, but I don't know the number of desired
> colors until after I have created my popup window.
> My popup doesn't create any draw widgets, if that matters.
> So, the question is:
>   Is it possible to use a popup window to get from the user the number
>  of desired gray-levels?
> I hope this is clear. Any tips most appreciated.
> Craig