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

Home » Public Forums » archive » Recovering Object Oriented References
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Recovering Object Oriented References [message #94225 is a reply to message #94224] Wed, 01 March 2017 19:40 Go to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Wednesday, March 1, 2017 at 6:55:29 PM UTC-7, Dave Schlossberg wrote:
> I have a routine that creates a window object using "p1 = Plot(x,y)" or similar.
>
> The program finishes executing, and now I have a window that persists. But I have no idea how to access it since p1 is not a global variable!
>
> Is there some way to query the current window for the reference, or to create a new reference for it?
> I suppose I could make p1 global, but this seems like a much more generic, general question.
>
> Thanks in advance,
> Dave
>
> p.s. I'm new to Object Oriented programming, but not to IDL. Used IDL extensively ~12 years ago for a while, then hiatus (grad school). Sorry if this is a noob question!

Welcome back to IDL. Lots of new language features since you were last here.

The simplest technique may be to apply a unique NAME property to each graphic you want to access later, but don't want to cache yourself.

Here's a quick example, uniquely naming the plot graphic "myplot".

IDL> .reset
IDL> p = plot(/test, name = 'myplot')
IDL> help, p
P PLOT <5168>
IDL> p = 0 ; "lose" the reference
IDL> w = getwindows(/current)
IDL> help, w
W GRAPHICSWIN <1812>
IDL> p = w['myplot']
IDL> help, p
P PLOT <5168>

For an example in the context of a widget application, see

http://www.harrisgeospatial.com/docs/IncludeGraphicInApp.htm l

Jim P.
[Message index]
 
Read Message
Read Message
Previous Topic: IDL Stat analysis- ANOVA licening
Next Topic: convolution of 1-D array with a function

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

Current Time: Wed Oct 08 15:14:00 PDT 2025

Total time taken to generate the page: 0.00780 seconds