LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InstallPopup popup does not result in a modal dialog box.

Environment: LabWindows/CVI 2017 FDS version 17.0.0 (295), Windows 7

 

In my application there is a main panel, PANEL, launched in the normal way using LoadPanel().  There is also an additional panel, OIVER, launched periodically using InstallPopup(). 

In the documentation for InstallPopup includes the following:

Displays and activates a panel as a modal dialog box.

You must call this function from the thread in which you create the panel.

While the modal dialog box is visible, the user cannot operate any other panels that you created in the same thread.

The panels for OIVER and PANEL are launched from the same thread and status = InstallPopup returns without error.  (i.e. status == 0).

The 3rd sentence in the description above seems not to be true.  If once the modal popup is launched, the main panel, or any of its buttons are clicked with the mouse, the main panel comes to the top, hiding the modal popup.  Additionally, all of the normal functionality of the main panel is available, thus making the panel created using InstallPopup anything but modal.

 

Is there a fix for this?

Note: I have tried using SetPanelAttribute(hOiver, ATTR_ZPLANE_POSITION, 0); as a workaround.

But because the popup is launched as a parent, this function fails.

 

 

 

0 Kudos
Message 1 of 2
(2,045 Views)

Is your application multithreaded? And if so, which thread is calling InstallPopup and which one is handling other panels?

A popup panel launched within one thread is modal only with respect to panels handled in the same thread: if you click on a panel displayed on anothre thread the previous modal one will not remain on top.

 

If you need the application to be multithreaded with the popups issued by threads other than the main one (which normally handles at least the main program panel and possibly all other ones) you can use PostDeferredCall to call a function in the main thread that installs the popup. You can pass parameters to that function via callbackData parameter of the deferred function. If you need some interaction between the popup and the thread, you will need to implement some interprocess communications between the main thread handling the popup and the separate thread requiring data.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,008 Views)