comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » cgWindow - what am I doing wrong that makes winID change values?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cgWindow - what am I doing wrong that makes winID change values? [message #91219] Wed, 17 June 2015 14:54 Go to next message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
I clearly don't understand the winID feature of Coyote graphics. This keyword is supposed to make it possible to direct graphics commands to different previously opened windows (winid = [the identifier of the window you want]). I'm finding, however, that the act of directing a graphics command to a window seems to change its winID. Consider the following example (IDL8.2, MacOSX10.8.5, Coyote graphics revision 1540):

IDL> cgWindow, wTitle = 'Window 1' ; Open the first window
IDL> w1ID = cgQuery(/Current) ; Determine its ID number
IDL> PRINT, w1ID ; Yup, it's 32
32
IDL> cgWindow, wTitle = 'Window 2' ; Open another window
IDL> w2ID = cgQuery(/Current) ; Get its ID number
IDL> PRINT, w2ID ; This one is 33
33
IDL> PRINT, w1ID ; The first ID still is 32
32
IDL> cgWindow, 'cgPlot', [0,10], [0,10], winID=w1ID, /AddCmd ; Plot something
IDL> PRINT, w1ID ; Oops - what happened to w1ID?
0
IDL> cgWindow, 'cgPlot', [0,10], [0,10], winID=w2ID, /AddCmd ; Try window 2
IDL> PRINT, w2ID
1 ; Same problem

Could this have something to do with giving the window titles? Seems strange to me. Thanks for any insights.

Barry
Re: cgWindow - what am I doing wrong that makes winID change values? [message #91228 is a reply to message #91219] Thu, 18 June 2015 07:21 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barry Lesht writes:

> Could this have something to do with giving the window titles? Seems strange to me. Thanks for any insights.

Idiot programmer. I'll see if I can sort it out and get back to you.
Finding Coyote will be a trick. Three women and four bill collection
agencies are after him. :-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgWindow - what am I doing wrong that makes winID change values? [message #91229 is a reply to message #91219] Thu, 18 June 2015 07:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barry Lesht writes:

> I clearly don't understand the winID feature of Coyote graphics. This
keyword is supposed to make it possible to direct graphics commands to
different previously opened windows (winid = [the identifier of the
window you want]). I'm finding, however, that the act of directing a
graphics command to a window seems to change its winID. Consider the
following example (IDL8.2, MacOSX10.8.5, Coyote graphics revision 1540):
>
> IDL> cgWindow, wTitle = 'Window 1' ; Open the first window
> IDL> w1ID = cgQuery(/Current) ; Determine its ID number
> IDL> PRINT, w1ID ; Yup, it's 32
> 32
> IDL> cgWindow, wTitle = 'Window 2' ; Open another window
> IDL> w2ID = cgQuery(/Current) ; Get its ID number
> IDL> PRINT, w2ID ; This one is 33
> 33
> IDL> PRINT, w1ID ; The first ID still is 32
> 32
> IDL> cgWindow, 'cgPlot', [0,10], [0,10], winID=w1ID, /AddCmd ; Plot something
> IDL> PRINT, w1ID ; Oops - what happened to w1ID?
> 0
> IDL> cgWindow, 'cgPlot', [0,10], [0,10], winID=w2ID, /AddCmd ; Try window 2
> IDL> PRINT, w2ID
> 1 ; Same problem
>
> Could this have something to do with giving the window titles? Seems strange to me. Thanks for any insights.

You can find an updated and fixed version of this program here:

http://www.idlcoyote.com/programs/cgwindow.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgWindow - what am I doing wrong that makes winID change values? [message #91233 is a reply to message #91229] Thu, 18 June 2015 16:26 Go to previous message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
Thanks, David.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: croping jpeg image
Next Topic: formatting y-axis when plotting relative frequency using cgHistoplot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:21:37 PDT 2025

Total time taken to generate the page: 0.00457 seconds