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

Re: How to pick a window?





AM wrote:
> 
> Hi,
> I am trying to find out which idl window I clicked on (ie, selected) if
> I have a number of them on the screen. I want to feed that back into a
> routine that then goes and does something depending on which window I
> click on. I am using the "old fashioned" windows created with 'window',
> rather than these new fangled "widget windows". Is here a solution or do
> I have to use widgets? I am using idl 5.4 in a unix environment. Maybe I
> can get the window manager to say something to idl?


No Iam sorry I have no solution to this but I will show you some trouble
you got if you don't save some system variables

tek_color
window,1,xs=100,ys=200 
plot,findgen(100)

window,2,xs=200,ys=100
plot,findgen(100)

wset,1
oplot,findgen(100),color=4

wset,2
oplot,findgen(100),color=4


oplot on window 1 gives no blue line.

IDL stores always only for the last plot in !x, !y and so on
the parameters which are necessary needed to add some plots later.

We have two useful routines in our library to get out of this trouble.

;+
; NAME:
;       savesysvar
;
; PURPOSE:
;       saves the settings of the !p, !x, !y, !z system
;       variables in a structure
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_html/dbase/download/savesysvar.tar.gz

+
; NAME:
;       restsysvar
;
; PURPOSE:
;       restores the settings of the !p, !x, !y, !z variables
;       from a structure previously saved with savesyvar()
;
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_html/dbase/download/restsysvar.tar.gz

For further routines and licensing please look at

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.html


regards

Reimar

-- 
Reimar Bauer 

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de

=============================================
a IDL library at ForschungsZentrum Jülich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.html

http://www.fz-juelich.de/zb/text/publikation/juel3786.html