Re: Managing several object instances [message #81495 is a reply to message #81483] |
Mon, 17 September 2012 22:28   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Tuesday, September 18, 2012 12:17:42 AM UTC+2, David Fanning wrote:
> Helder writes:
>
>
>
>> However, I'm not coming around a problem. How can I efficiently keep track of the generated object instances. Suppose the user generates 5 line profiles, and destroys the third and then generates a new one and so on and so forth.
>
>> What is the most efficient way of keeping track of the existing/running object instances so that I can efficiently pass around my token?
>
>> That means that I need to be able to add and delete object instances in a record and at any time be able to know which ones are working and active...
>
>
>
> Why would you want to keep track of them?
>
>
>
> Just write a program that does what you want it to do
>
> (resize, save, etc.) and send it forth from your other
>
> program. When the user is finished with it, he or she
>
> will kill it. What do you care?
>
>
>
> Make sure you call the program with a Group_Leader, which
>
> will be the top-level base of your GUI. Then, when your
>
> GUI dies, all the programs that were spawned from it
>
> (however many are still left!) will be destroyed, too.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> P.S. You could use cgWindow to display your image profiles,
>
> for example, then you already have all the resizing and saving
>
> built right in. You really don't have anything at all to do,
>
> except fill up the windows with the right commands.
>
>
>
> --
>
> 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.")
Thanks for the answer David,
however I'm still puzzled by the fact that when something changes in the main program (the image), the object instances have to be modified. If I don't know which instances are running I don't know which window I should tell something.
There is probably an easy solution and it's there right in front of me, but I seem to be running around it.
Cheers,
Helder
PS: Using cgWindow is good, but I would like to add some extra functionality to the plot so that the user can change the line thickness, style, color,... Since I like reinventing wheels, I've managed the resizable graphics and saving on my own with quite a few limitations, but it does the job.
|
|
|