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

Home » Public Forums » archive » Re: Top-level bases
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: Top-level bases [message #41063 is a reply to message #41054] Thu, 23 September 2004 00:42 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Andrew Rodger writes:

> If I have a pop-up window that was started from within an event
> handler for the primary widget, and I am using the primary widgets
> event function code to handle the events (see below), how do I
> maintain the link to my state data when the pop-up access the event
> function code?
>
> widget_control,'air',tlb,/realize
> xmanager,'air',tlb,event_handler='the same piece of code it is already
> in',/no_block

Typically, we put all the information required to run
our widget program into an info or state structure. Then,
we often pass this structure around in the UValue of the
top-level base. But, in this situation you have *two* top
level bases, although there is a relationship between them:
you called one from the other. So, in principle, you could
pass whatever the second TLB needed from the first when you
call it. That is to say, you could make a copy of the info
structure and pass *that* to the second TLB to store in the
UValue of its TLB.

But now you have two copies of the info structure. Probably
a bad idea.

So, alternatively, you could make one copy of the info
structure, and store a pointer to that info structure in
the UValue of any TLB that required the info structure
information.

That is what I would do in this case. Because a pointer is
very light weight, you can make hundreds of copies and pass
them out like candy. They all point to the same piece of
information. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: - unsigned variables
Next Topic: Re: - unsigned variables

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

Current Time: Sun Oct 12 04:43:09 PDT 2025

Total time taken to generate the page: 0.08083 seconds