LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait till a panel was closed

I would like to open a panel in a selfwritten function and close it in
a Callbackfunction of this panel and then return to the selfwritten
function, where the panel was opened and displayed. So the function
has to "wait" till the panel was closed. How can I do that?
0 Kudos
Message 1 of 3
(3,214 Views)
the best way I have found to do this is to use RunUserInterface()/QuitUserInterface(). These functions can be 'nested' in your program. So in the calling function you would have something like:

DisplayPanel(...);
RunUserInterface();


then in the panel callback you would have e.g.:


HidePanel(...)
QuitUserInterface(0);


--
Martin
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 3
(3,214 Views)
You can call InstallPopup() to display the panel, GetUserEvent() to wait for the panel, and RemovePopup(0) to remove it.
InstallPopup() displays and activates a panel as a modal dialog box. You can't operate controls on any other panel in the same thread. You need to call LoadPanel on the panel before calling InstallPopup.
GetUserEvent(), with the wait mode set True, will wait for a commit event to be generated. It returns the control ID. If you want to continue only on EVENT_COMMIT from a certain control, you can call GetUserEvent in a loop until the control ID matches the one you want. Since InstallPopup sets the popped-up panel to be modal, you will only get EVENT_COMMITs from the popup panel.
RemovePopup(0) removes the active popup.
0 Kudos
Message 3 of 3
(3,214 Views)