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

Home » Public Forums » archive » Re: Obtaining the number of the current color table
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Obtaining the number of the current color table [message #17988 is a reply to message #17986] Tue, 23 November 1999 00:00 Go to previous messageGo to previous message
m218003 is currently offline  m218003
Messages: 56
Registered: August 1999
Member
In article <383905FE.199BD844@mpia-hd.mpg.de>,
Markus Feldt <mfeldt@mpia-hd.mpg.de> writes:
>
> --------------044D86DA089246E71003A164
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi All,
>
> currently I am writing a package of software that for some reason has
> to keep track of the currently active colortable. To give the user a
> chance to adjust this table, I am calling (since it all has to be
> GUIfied these days...) xloadct - but xloadct itself does not give back
> the number of the loaded table.
>
> Does anybody know how to comfortably obtain this number? I know there
> is XCOLORS which might help via an event, but I'd rather rely on
> standard functions...
>
This is not as easy as you may think: first of all, LOADCT (the non-GUI
equivalent of XLOADCT) accepts keywords like BOTTOM or NCOLORS which have
an obvious effect on *how* the color table is loaded *and* which allow
you to have more than one "active" colortable at a time. Furthermore,
you can manipulate individual entries in the colortable (see for example
David F's GETCOLOR program). Therefore, strictly speaking, there is no
such thing as "the currently active colortable". What is offered in IDL
though, is the retrieval of the three currently active color vectors:
TVLCT,r,g,b,/GET
This returns one vector for each red, green, and blue typically of length
100-220 on 8 bit displays, and 256(?) on 24 bit displays. If you want to make
sure to use exactly these same colors again later on, you can store these
values in the UVALUE field of your widget (as you mentioned everything is
GUIfied), then call TVLCT,r,g,b to set them back. But be aware of side-effects
when you have more than one window on the screen!

Regards,
Martin.

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Number of colors of widget appliation
Next Topic: Re: FORTRAN to IDL translation

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

Current Time: Sun Oct 12 09:58:28 PDT 2025

Total time taken to generate the page: 1.43518 seconds