Re: Sharing an info structure [message #19950] |
Sat, 06 May 2000 00:00 |
Daniel Peduzzi
Messages: 29 Registered: June 1999
|
Junior Member |
|
|
Mark Guagenti wrote in message ...
>
> 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!
>
One way to do this is to save the main window TLB identifier as a user
value for your toolbar TLB. Then, whenever you write an event_pro for
a button on your toolbar, you can include the lines:
widget_control, event.top, get_uvalue=main_tlb
widget_control, main_tlb, get_uvalue=info
Dan
---------------------------------------
Dan Peduzzi
peduzzi@mediaone.net
---------------------------------------
|
|
|
|
Re: Sharing an info structure [message #19952 is a reply to message #19950] |
Sat, 06 May 2000 00:00  |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
Mark Guagenti, mgenti@evansville.net writes:
> 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.
There are many ways to do this, but the simplest is to get your
toolbar to use WIDGET_CONTROL /SEND_EVENT to send a new, custom event
to the top level base and to call the actual procedure from the top
level base's event handler. The custom event must have the correct
first three fields, but you can put whatever you like in subsequent
fields to tell the top level base where the event is coming from or
what it should do. Alternately, make the custom event a
non-anonymous, named structure and the top level base's event handler
can test all events for that particular structure name using the
TAG_NAMES /STRUCTURE_NAME function.
The 'modern' and more flexible way is to make your widgets into
objects and have the toolbar call a method belonging to the top level
base. This isn't as hard as it sounds and is very powerful as a
general technique.
> 1 Cor. 1:3
I first read that as 1 Cor. 13. Hope and Faith are essential
in IDL progamming. This newsgroup provides the Charity.
Struan
|
|
|