Re: Colormaps (a favorite subject!) [message #19445 is a reply to message #19441] |
Fri, 24 March 2000 00:00  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
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.
You could save the user preference in a file, and read it in. It wouldn't work
for the same session, but at least it would be something.
JD
--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
|
|
|