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

Home » Public Forums » archive » Re: How to make color-scale legend
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: How to make color-scale legend [message #999 is a reply to message #852] Tue, 13 April 1993 06:46 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
ruckman@oasys.dt.navy.mil writes:

(Stuff deleted)

> I had to make a minor modification that I suspect is needed often by users of
> IDL for Windows. The procedures use different techniques depending on the
> current device, but they were written before the 'WIN' device existed.
> Therefore, whenever I found a command such as

> if !d.name eq 'X' then begin

> I had to change it to

> if !d.name eq 'X' or !d.name eq 'WIN' then begin

Even better would be to just ask if the device has windows, e.g.

if have_windows() then begin

The following routines will test if a device supports windows and widgets
(which I understand that IDL for Windows now supports).

FUNCTION HAVE_WINDOWS
RETURN,(!D.FLAGS AND 256) NE 0
END

FUNCTION HAVE_WIDGETS
RETURN,(!D.FLAGS AND 65536) NE 0
END

One could simply put the references to !D.FLAGS directly into the calling
routine, but I feel that putting them into separate routines like this makes
for more understandable code.

This way you don't have to keep adding device names to your routines, e.g.
"or !d.name eq 'SUN'" in your example above.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Making help for your own functions & procedures
Next Topic: How to make 2-d plots in 3-d?

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

Current Time: Fri Nov 28 12:00:19 PST 2025

Total time taken to generate the page: 0.01750 seconds