12-12-2019 10:40 AM
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
12-12-2019 10:52 AM
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.)
12-12-2019 01:00 PM
Try the following, VIs attached. (Windows only, sorry)
mcduff
12-13-2019 03:04 AM
@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).
12-13-2019 03:09 AM
@mcduff wrote:
Try the following, VIs attached. (Windows only, sorry)
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...
12-13-2019 07:49 AM
wiebe@CARYA wrote:
@mcduff wrote:
Try the following, VIs attached. (Windows only, sorry)
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