QUOTE (Dave Graybeal @ Oct 3 2008, 04:27 PM)
Thanks a lot for this suggestion. It does look very nice. I may use it somewhere, although perhaps pdc's solution (VI Properties, Windows Appearance -> Dialog) is perfectly adequate for what I need.
pg
QUOTE (MJE @ Oct 3 2008, 04:41 PM)
Having the task as a Dialog VI is probably the easiest way of doing it, as pdc mentioned. When the task is done, the dialog will close and all's said and done.
There are other ways though. Maybe you want your task to be run outside of the UI thread, maybe it's asynchronous with respect to the rest of your code, or maybe there's the possibility of multiple tasks but you only want one dialog? In situations like that I usually use one of the synchronization objects (a dynamic event/occurrence/notifier/queue), the VI that spawns the worker task creates the event/whatever, and feeds it to both the dialog and the worker task. When the worker task is done, it signals the event, to which the dialog responds and closes. Just be careful not to create a race condition where it's possible for the worker thread to signal the sync object before the dialog blocks. Which object to use really depends on what you want to do, is a simple signal all you need or do you need to send data with the signal? Do you need to respond to multiple signals?
Thanks for the reply. In fact, the problem is quite elementary. There is no need to send any data with the signal, there no other tasks (the application is perfectly linear - apart from the popup window ). For "serious stuff" I would not hesitate to use synchronization objects, but here... it seems like overkill. BTW, looking at the JKI pwd solution confirms your observation: he uses notifiers.
pg