Re: Close window command? [message #49490 is a reply to message #49395] |
Mon, 24 July 2006 13:23   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Mike Chinander wrote:
> In article <1153769529.483637.316050@h48g2000cwc.googlegroups.com>,
> <adisn123@yahoo.com> wrote:
>
>> Hello,
>>
>> My program generates 4 different images in 4 different window in one
>> operation.
>>
>> It is quite tedious to close every window after display to run the
>> program again after I change some
>>
>> parameters in the program in order to see new 4 images.
>>
>> I'm wondering there is a way to kill/close the old windows when the
>> program starts over.
>>
>> Thank you.
>>
>
>
> This should delete all open windows:
>
> IDL> while !D.WINDOW ne -1 do wdelete
>
> if you know the window indices of the four windows your program creates, you can do:
>
> IDL> wdelete, w_ind1, w_ind2, w_ind3, w_ind4
>
> where w_ind1, w_ind2, ... correspond to the window indices of your open windows.
>
> Hope that helps,
Or, if you want to add more open windows in the future (hey, computer screens are getting
bigger all the time!) you could do:
nWin=4
winID=lonarr(nWin)
for i=0,nWin-1 do begin
window, /free
winID[i]=!d.window
endfor
...do stuff....
; plot to first window
wset, winID[0]
plot, .....
; plot to second window
wset, winID[1]
plot, .....
etc....
; done
for i=0,nWin-1 do wdelete, winID[i]
?
Increase nWin as required.
Using the above you could have additional windows open that you *don't* want destroyed
every time you rerun your code.
Or, even more simply, you could just do
!p.multi=[0,2,2]
and avoid the multiple windows altogether. :o)
paulv
--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|