LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

popup dialog

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.

0 Kudos
Message 1 of 5
(308 Views)

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.

Message 2 of 5
(294 Views)

@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:

paul_a_cardinale_0-1723284330164.png

 

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".

0 Kudos
Message 3 of 5
(283 Views)

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.

0 Kudos
Message 4 of 5
(261 Views)

Here's a very simple example

 

altenbach_0-1723313880087.png

 

0 Kudos
Message 5 of 5
(249 Views)