08-10-2024 12:07 AM
I have a question about what seems to be a simple yet complex issue.
I want to create a dialog box that displays a message for about 2 seconds before disappearing.
Since a typical subVI would be blocked by the popup dialog for 2 seconds, this approach might not be suitable. I considered using the "Wait until done (F)" function with Run VI, which allows for showing the message while continuing with subsequent processes.
However, the popup dialog remains in a stopped state after the 2 seconds, as it hasn't been closed.
What would be the best approach to achieve my objective?
labmaster.
08-10-2024 02:44 AM
Now that I think about it, I can implement closing the pop-up dialog by using FP.state property node->close after the routine is finished. Is there a more reliable method?
labmaster.
08-10-2024 05:06 AM
@labmaster wrote:
I have a question about what seems to be a simple yet complex issue.
I want to create a dialog box that displays a message for about 2 seconds before disappearing.
My, how annoying for the user. Why not push it to the hilt:
Make a 2-button dialog box that monitors mouse movements, and when the mouse gets close to one button, it selects the other, then closes. Maybe have it look something like this:
As for your question: You don't need to explicitly close a dialog box; in the VI properties, just set the window appearance to "Dialog".
08-10-2024 11:41 AM
Yes, all you need is to set the popup to dialog and launch asynchronously (and there are also many ways to do that directly e.g. just call it from and independent toplevel helper loop to prevent the main code from stalling).
Of course in development mode you need to make sure that the window of the popup is closed before starting the main program. (because the closing is conditional to "if previously closed")
I agree this is not a great UI form a user perspective, because they cannot interact with the main program while the dialog displays. You could set it to non-modal and have it set itself frontmost in a softer way.
Why not e.g. have a string indicator on the main program that displays the last 10 messages, for example.
08-10-2024 01:18 PM