Re: WSet to negative value [message #74412] |
Tue, 18 January 2011 05:59  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brian writes:
> I get the same result.
Alright. Well, it's always surprising what you
learn about IDL. :-)
This is certainly helping to keep the dirty
fingers off my widget display windows. Thanks
for everyone's help.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: WSet to negative value [message #74413 is a reply to message #74412] |
Tue, 18 January 2011 04:49   |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Jan 18, 5:17 am, Wox <s...@nomail.com> wrote:
> IDL> print,!version
> { x86_64 linux unix linux 8.0 Jun 18 2010 64 64}
> IDL> plot, sin(findgen(30)*0.135)
> IDL> window, 1
> IDL> plot,cos(findgen(30)*0.135)
> IDL> wset,-1
> IDL> xyouts,0.5,0.5,'Dada',/normal ; appears in window 1
> IDL> wset,-2
> % WSET: Window is closed and unavailable.
> % Execution halted at: $MAIN$
I get the same result.
IDL> print,!version
{ x86_64 darwin unix Mac OS X 7.1.1 Aug 19 2009 64 64}
IDL> plot,sin(findgen(30)*0.135)
IDL> window,1
IDL> plot,cos(findgen(30)*0.135)
IDL> wset,-1
IDL> xyouts,0.5,0.5,'Dada',/Normal ; appears in window 1
IDL> wset,-2
% WSET: Window is closed and unavailable.
% Execution halted at: $MAIN$
|
|
|
Re: WSet to negative value [message #74414 is a reply to message #74413] |
Tue, 18 January 2011 02:17   |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
IDL> print,!version
{ x86_64 linux unix linux 8.0 Jun 18 2010 64 64}
IDL> plot, sin(findgen(30)*0.135)
IDL> window, 1
IDL> plot,cos(findgen(30)*0.135)
IDL> wset,-1
IDL> xyouts,0.5,0.5,'Dada',/normal ; appears in window 1
IDL> wset,-2
% WSET: Window is closed and unavailable.
% Execution halted at: $MAIN$
|
|
|
Re: WSet to negative value [message #74415 is a reply to message #74414] |
Tue, 18 January 2011 01:41   |
Vontobel Peter
Messages: 4 Registered: February 2000
|
Junior Member |
|
|
On 18 Jan., 00:26, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> I was just fooling around with a program and realized I can
> do a WSet, -1 in this version of IDL (Windows 7.1.2). I am convinced
> this was not always possible, since I have written a lot of
> code in my day like this:
>
> IF currentWindow GE 0 THEN WSet, currentWindow
>
> I wonder if this is a Windows thing, or an IDL version thing.
> If anyone running an older version of IDL could try to set
> their graphics window to -1, I would love to hear what version
> of IDL you are running and what the results are:
>
> WSet, -1
>
> Thanks,
>
> Cheers,
>
> David
>
> P.S. I am just putting the final touches on a completely
> revamped FSC_Window program. It is working great. You can
> have multiple resizeable graphics windows, add and delete
> commands to/from the windows, replace commands, display multiple
> commands in the window, list the commands in the window,
> choose which of several windows you want to work with,
> send the commands to a PostScript file, make raster image
> files out of the window using ImageMagick or not, etc.
> I quite honestly have never seen anything like it in IDL. :-)
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
IDL> print, !version
{ x86 Win32 Windows Microsoft Windows 6.3 Mar 23 2006 32 64}
IDL> plot, sin(findgen(30)*0.135)
IDL> window, 1
IDL> plot,cos(findgen(30)*0.135)
IDL> wset, -2
IDL> xyouts,0.5,0.5,'Dada',/normal
Hi David,
Text legend appears in last window for wset, -2 or wset, -2
|
|
|
Re: WSet to negative value [message #74416 is a reply to message #74415] |
Mon, 17 January 2011 15:42   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 1/17/11 4:26 PM, David Fanning wrote:
> Folks,
>
> I was just fooling around with a program and realized I can
> do a WSet, -1 in this version of IDL (Windows 7.1.2). I am convinced
> this was not always possible, since I have written a lot of
> code in my day like this:
>
> IF currentWindow GE 0 THEN WSet, currentWindow
>
> I wonder if this is a Windows thing, or an IDL version thing.
> If anyone running an older version of IDL could try to set
> their graphics window to -1, I would love to hear what version
> of IDL you are running and what the results are:
>
> WSet, -1
>
> Thanks,
>
> Cheers,
>
> David
>
> P.S. I am just putting the final touches on a completely
> revamped FSC_Window program. It is working great. You can
> have multiple resizeable graphics windows, add and delete
> commands to/from the windows, replace commands, display multiple
> commands in the window, list the commands in the window,
> choose which of several windows you want to work with,
> send the commands to a PostScript file, make raster image
> files out of the window using ImageMagick or not, etc.
> I quite honestly have never seen anything like it in IDL. :-)
>
It's not a Windows thing:
IDL> wset, -1
IDL> wset, -2
% WSET: Window is closed and unavailable.
% Error occurred at: $MAIN$
% Execution halted at: $MAIN$
From the docs for WSET:
"If you set Window_Index equal to -1, IDL will try to locate an existing
window to make current, ignoring any managed draw widgets that may
exist. If there is no window to make current, WSET changes the value of
the WINDOW field of the !D system variable to -1, indicating that there
are no current windows."
I'm running 8.0.1 on Mac OS X:
IDL> print, !version
{ x86_64 darwin unix Mac OS X 8.0.1 Oct 5 2010 64 64}
Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
|
|
|
Re: WSet to negative value [message #74505 is a reply to message #74415] |
Tue, 18 January 2011 12:33  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
VP wrote:
> IDL> print, !version
> { x86 Win32 Windows Microsoft Windows 6.3 Mar 23 2006 32 64}
> IDL> plot, sin(findgen(30)*0.135)
> IDL> window, 1
> IDL> plot,cos(findgen(30)*0.135)
> IDL> wset, -2
> IDL> xyouts,0.5,0.5,'Dada',/normal
>
> Hi David,
>
> Text legend appears in last window for wset, -2 or wset, -2
IDL> print, !version
{ ibmr2 AIX unix AIX 6.4 Mar 24 2007 64 64}
IDL> plot, sin(findgen(30)*0.135)
IDL> window, 1
IDL> plot,cos(findgen(30)*0.135)
IDL> wset, -2
% WSET: Window is closed and unavailable.
% Execution halted at: $MAIN$
IDL> wset, -1
IDL> xyouts,0.5,0.5,'Dada',/normal
Similarly with VP, the text appears in last window for "wset, -1". But, as you can see, "wset, -2" generates an error.
Doing
IDL> wset,0
IDL> wset, -1
IDL> xyouts,0.5,0.5,'Dada',/normal,charsize=4
put a big "Dada" on window #1 (not 0). Looks like "wset, -1" picks the last window opened/created.
Sort like how IDL v8 has the -1 array index capability to indicate the last item in an array..... <ehem>
cheers,
paulv
|
|
|