1)analog #define in IDL? 2) get position of a window? [message #4059] |
Thu, 27 April 1995 00:00  |
feigin
Messages: 3 Registered: April 1995
|
Junior Member |
|
|
Dear colleagues,
1. The problem is that it's necessary to define some variables in a IDL program
in such a way that allows easy to change them in the future. I understand
that it may be implemented via using COMMON BLOCKS but it's extremely poor
style.
Is there some directive in IDL similar pre-processor directive
#define in C?
2. According to IDL Reference Guide p.3-14 keyword GET_WINDOW_POSITION (to DEVICE proc)
returns (X,Y) position of the current window on the screen. What does it
mean 'current' window? Is this a window that has been constructed the last?
Or is it an active window? To put in other way, I'd like to know a position
of a c o n c r e t e window on the screen. How can I get it?
Is it possible to use ID of this window in any way?
Sincerely,
Michael.
|
|
|
Re: 1)analog #define in IDL? 2) get position of a window? [message #4114 is a reply to message #4059] |
Wed, 03 May 1995 00:00  |
rep2857
Messages: 28 Registered: December 1994
|
Junior Member |
|
|
Cc'd to feigin@saturn.gas.unsw.EDU.AU
In article <3nnhvl$p8c@mirv.unsw.edu.au>,
Michael Feigin,ARC Research Fellow,AS,951231 <feigin@saturn.gas.unsw.EDU.AU> wrote:
>
> 2. According to IDL Reference Guide p.3-14 keyword GET_WINDOW_POSITION (to DEVICE proc)
> returns (X,Y) position of the current window on the screen. What does it
> mean 'current' window? Is this a window that has been constructed the last?
> Or is it an active window? To put in other way, I'd like to know a position
> of a c o n c r e t e window on the screen. How can I get it?
> Is it possible to use ID of this window in any way?
>
That would be the position of !D.Window. !D.Window can be set using the
WSet, window_id command.
IDL> window, 0 & window, 1 ; open two windows
IDL> print, !D.Window ; See which window is current
1
IDL> WSet, 0 ; set the current window to 0
IDL> print, !D.Window ; verify the current window has been reset
0
Will this next command give you an idea of how you can use it? I'm not
sure what you're trying to do, but can probably help out if given a
couple of specifics. Some ideas: destroy it and recreate it with a
different size; read the data from this window and write it to a file;
copy data from this window to another window ...
IDL> help, !D, /Struct
** Structure !DEVICE, 17 tags, length=80:
NAME STRING 'X'
X_SIZE LONG 640
Y_SIZE LONG 512
X_VSIZE LONG 640
Y_VSIZE LONG 512
X_CH_SIZE LONG 6
Y_CH_SIZE LONG 10
X_PX_CM FLOAT 40.0000
Y_PX_CM FLOAT 40.0000
N_COLORS LONG 242
TABLE_SIZE LONG 242
FILL_DIST LONG 1
WINDOW LONG 0
UNIT LONG 0
FLAGS LONG 65980
ORIGIN LONG Array(2)
ZOOM LONG Array(2)
Mike Schienle Hughes Santa Barbara Research Center
Home: mgs@visdata.com Coromar Drive, M/S B28/87
Work: rep2857@sbsun0010.sbrc.hac.com Goleta, CA 93117
Contract Employee. Will visualize data for large amounts of money.
|
|
|
Re: 1)analog #define in IDL? 2) get position of a window? [message #4131 is a reply to message #4059] |
Sun, 30 April 1995 00:00  |
todd
Messages: 25 Registered: February 1994
|
Junior Member |
|
|
In article <3nnhvl$p8c@mirv.unsw.edu.au>, feigin@saturn.gas.unsw.EDU.AU (Michael Feigin,ARC Research Fellow,AS,951231) writes:
|>
|> Dear colleagues,
|>
|>
|> 1. The problem is that it's necessary to define some variables in a IDL program
|> in such a way that allows easy to change them in the future. I understand
|> that it may be implemented via using COMMON BLOCKS but it's extremely poor
|> style.
|> Is there some directive in IDL similar pre-processor directive
|> #define in C?
I believe someone already mentioned it, but to be complete: use an
include file. Make your definitions in a file, say define.pro, then
include it where necessary via @define.pro.
|> 2. According to IDL Reference Guide p.3-14 keyword GET_WINDOW_POSITION (to DEVICE proc)
|> returns (X,Y) position of the current window on the screen. What does it
|> mean 'current' window? Is this a window that has been constructed the last?
|> Or is it an active window? To put in other way, I'd like to know a position
|> of a c o n c r e t e window on the screen. How can I get it?
|> Is it possible to use ID of this window in any way?
|>
The device call accesses the curent device. So you get the
position of the currently active window.
Okay, you want the position of window 3:
idl> wset,3
idl> device,get_window_postion=pos
|> Sincerely,
|>
|> Michael.
|>
S`all right?
Todd
--
Todd Ratcliff
UCLA Dept. of Earth & Space Sciences
Room 2707 Geology Building
UCLA Box 951567
Los Angeles, CA 90095-1567 todd@artemis.ess.ucla.edu
(310)825-3118 http://artemis.ess.ucla.edu/~todd/home.html
|
|
|