Programmatically close all function graphics windows [message #93576] |
Thu, 25 August 2016 07:50  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
Is there a way to programmatically close all function graphics windows (as opposed to clicking the close button). In direct graphics the following code will do this
Device,window_state = w ;Get a list of all windows
g = where(w,/null) ;Which ones a open?
for each win,g do wdelete,win ;Delete the open windows
In function graphics, if you have the all the plot reference objects, say p1, p2, p3 then you can close the windows with p1.close, p2.close,p3.close But what if you haven't saved the plot reference objects?
Thanks, -Wayne
|
|
|
Re: Programmatically close all function graphics windows [message #93577 is a reply to message #93576] |
Thu, 25 August 2016 09:27   |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le jeudi 25 août 2016 16:50:20 UTC+2, wlandsman a écrit :
> Is there a way to programmatically close all function graphics windows (as opposed to clicking the close button). In direct graphics the following code will do this
>
> Device,window_state = w ;Get a list of all windows
> g = where(w,/null) ;Which ones a open?
> for each win,g do wdelete,win ;Delete the open windows
>
> In function graphics, if you have the all the plot reference objects, say p1, p2, p3 then you can close the windows with p1.close, p2.close,p3.close But what if you haven't saved the plot reference objects?
>
>
> Thanks, -Wayne
You might use GETWINDOWS() function.
alx.
|
|
|
Re: Programmatically close all function graphics windows [message #93578 is a reply to message #93577] |
Thu, 25 August 2016 11:06  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
Yes, GETWINDOWS() is what I need -- thanks!
So to close all currently open windows
IDL> pwin = getwindows()
IDL> foreach p,pwin do p.close
-Wayne
On Thursday, August 25, 2016 at 12:27:56 PM UTC-4, alx wrote:
> Le jeudi 25 août 2016 16:50:20 UTC+2, wlandsman a écrit :
>> Is there a way to programmatically close all function graphics windows (as opposed to clicking the close button). In direct graphics the following code will do this
>>
>> Device,window_state = w ;Get a list of all windows
>> g = where(w,/null) ;Which ones a open?
>> for each win,g do wdelete,win ;Delete the open windows
>>
>> In function graphics, if you have the all the plot reference objects, say p1, p2, p3 then you can close the windows with p1.close, p2.close,p3.close But what if you haven't saved the plot reference objects?
>>
>>
>> Thanks, -Wayne
>
> You might use GETWINDOWS() function.
> alx.
|
|
|