LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Close a pop-up after time delay

Hello, 

 

I'm using pop-up / dialog boxes and I would like to close them after 5 seconds if anyone click on it.

I've searched a lot on this problem but can't find anything.

 

Thanks in advance

Damien

0 Kudos
Message 1 of 6
(4,448 Views)

I know this is going to be cumbersome, but create a subVI that shows its front panel while it is open and closes it afterwards.  Have an event to capture a timeout of 5000 ms or user clicks a button to make it go away sooner.  (The event doesn't have to be in a loop since whatever is going to happen only happens once.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 6
(4,434 Views)

Try the following, VIs attached. (Windows only, sorry)

 

mcduff

 

snip.png

Download All
Message 3 of 6
(4,391 Views)

@damienclmt wrote:

I'm using pop-up / dialog boxes and I would like to close them after 5 seconds if anyone click on it.


Do you want to close all dialogs, at the same time, after 5 seconds? Or close each individual dialog after 5 seconds? That's a huge differences.

 

Usually, you want to close dialogs if anyone did not click on it? Like a time out? It doesn't make much sense (to me) to close a dialog after 5 seconds if anyone did click on it. Then I'd close straight away...

 

You can close any FP anytime if you have a reference. It's cleaner to have each dialog close itself (with the suggested event structure). But if you want, you can get all VI references from memory, get all open Front Panel references from them, and close them all (optionally only if they are dialogs).

0 Kudos
Message 4 of 6
(4,268 Views)

@mcduff wrote:

Try the following, VIs attached. (Windows only, sorry)

snip.png


Good point. If these dialogs are build in One|Two|Three Button Dialogs, it's a totally different story.

Dialogs could be VIs (set to modal).

 

Guess OP has some explaining to do...

0 Kudos
Message 5 of 6
(4,262 Views)

wiebe@CARYA wrote:

@mcduff wrote:

Try the following, VIs attached. (Windows only, sorry)

snip.png


Good point. If these dialogs are build in One|Two|Three Button Dialogs, it's a totally different story.

Dialogs could be VIs (set to modal).

 

Guess OP has some explaining to do...


The hack I posted "works" for the one/two button dialogs that are system dialogs, not LabVIEW ones. The second example I posted shows how to exit a two button dialog. Other dialogs may work, but the trick to the hack is that the key focus is on a particular button, like the dialogs in the examples I posted. The buttons respond to mouse clicks or pressing a key.

 

mcduff

0 Kudos
Message 6 of 6
(4,186 Views)