DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle pop-up windows (warnings, user inputs, etc.)

Solved!
Go to solution

Hello guys, 

 

I was wondering how to handle Pop-Up windows in a DQMH module. For simple user-inputs I am placing the pop-up window directly in the Event-Handling Loop. The windows are modal and ask the user to insert f.ex. a number. And depending on the input I decide if I want to cancel or forward the event to the Message Handling Loop. 

This worked out for me in simple cases (but maybe there is a besser solution).

 

But I have no good approach to handle pop-ups that depend on the state-data of the DQMH-Module. f.ex. a popup that informs the user about unsaved changes. I cant pup this in the MHL, because it would block the whole loop.

 

Are there best practices for this case? 

 

Thanks!

0 Kudos
Message 1 of 4
(1,558 Views)
Solution
Accepted by topic author hallo2014

If both of those things are true, if the window is modal and also the output of it determines the next state you go into, then putting the VI in the EHL is a pretty solid solution and I've definitely done that with the "Save/Don't Save/Cancel" dialog a few times. Was there a non-simple instance where you did that and it didn't work out?

 

Edit:

 


@hallo2014 wrote:

But I have no good approach to handle pop-ups that depend on the state-data of the DQMH-Module


My bad you answered me I just didn't see it. My approach would be to call it async with the Call and Collect option, and in some way let the main program know once the dialog has been completed, either with a simple message/event/notifier, or by repeatedly calling Wait for Asynch to collect the output in a helper loop and looking for the lack of a timeout error as an indication that the dialog has been exited.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 2 of 4
(1,546 Views)

There's a rather simple way to open a (dialog) window without blocking execution. You can call your dialog VI asynchronously and opt to not collect the results ("call and forget"). A quick search shows a few forums posts describing this (example). 




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )


0 Kudos
Message 3 of 4
(1,543 Views)

Thank you for your suggestions. I will try them out!

0 Kudos
Message 4 of 4
(1,524 Views)