Re: launching many widgets at the same time [message #44484] |
Wed, 15 June 2005 04:37 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
KK T wrote:
> I am new to IDL programming. The following is what I had been trying
> without any books on hand.
>
> I had created 3 .pro files of simple widget UI
> called: widgetA.pro, widgetB.pro and widgetC.pro.
>
> I had created another .pro files which made a call to all of them as
> such
>
> pro main
> widgetA
> widgetB
> widgetC
> end
>
> I run the main under IDL IDE and all widgets displayed on the screen.
> However, when I build and export as a runtime executeable, only widgetA
> appears on the screen. When I close this widget, widgetB appears and so
> on.
>
> Do I have to use threads in the main such that all widgets will get to
> appear at the same time on the screen?
Here is an article, written some time ago, but still probably relevant:
http://www.dfanning.com/widget_tips/multiple_widgets.html
Basically, because the widget event loop will block in a run-time
environment, you want to run your programs with the JUST_REG keyword
set on the XMANAGER call for your widget programs. Then, when all the
programs are on the display, a single XMANAGER call will start the
event loop for all three at once. It will look *something* like this:
pro main
widgetA, /Just_Reg
widgetB, /Just_Reg
widgetC, /Just_Reg
XManager
end
Where, say, widgetA (as well as the others) is defined like this:
pro widgeta, JUST_REG=just_reg
...
xmanager, ..., JUST_REG=Keyword_Set(just_reg)
end
Cheers,
David
|
|
|