Sharing an info structure [message #19954] |
Fri, 05 May 2000 00:00  |
Mark Guagenti
Messages: 14 Registered: May 2000
|
Junior Member |
|
|
Hello,
I'm just starting to learn IDL and am working on an application that has a
main window(widget) and also has another window(widget) that I want to use
as a toolbar. My problem seems to be when I call a procedure when one of
the buttons gets clicked from the toolbar. I want to be able to get the
the structure (called info) that is used for my top level base, and use
that information in the procedure I called from my toolbar window. If
anyone could please explain how I can do this it would be very
apreciated. Thanks!
-- Mark
Grace and peace to you from God our Father and the Lord Jesus Christ.
1 Cor. 1:3
|
|
|
Re: Sharing an info structure [message #20065 is a reply to message #19954] |
Wed, 10 May 2000 00:00  |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
When I do this, I (being lazy) usually make the event handler for the
toolbar to be the same as the main window's event handler. Then, since
the toolbar is usually a dependent base (created with GROUP_LEADER
keyword), the State (or Info) structure is retrieved easily in the event
handler, whether it is in the TLB UVALUE, or, as recommended by many, in
the first child' uvalue of the TLB. One way to easily share the Info
structure with the daugther base is to place a pointer to it in the
UVALs of both top base and daugter base. This way, no matter who updates
Info, next call will have updated results. In fact, for small
applications this is transparent to the point I don't even discern which
base sent the event. For large applications, as David pointed out more
than once, several separate event handlers are advantageous. I admit,
despite the "objectization of widgets" trend that is so popular among
top-end folks here on the group, I still put together well-working
ad-hoc code without widgects. I am not among the top guys :-)
Cheers,
Pavel
Mark Guagenti wrote:
>
> Hello,
> I'm just starting to learn IDL and am working on an application that has a
> main window(widget) and also has another window(widget) that I want to use
> as a toolbar. My problem seems to be when I call a procedure when one of
> the buttons gets clicked from the toolbar. I want to be able to get the
> the structure (called info) that is used for my top level base, and use
> that information in the procedure I called from my toolbar window. If
> anyone could please explain how I can do this it would be very
> apreciated. Thanks!
>
> -- Mark�
|
|
|