LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

About RemovePopup() function

Hi,

 

When using RemovePopup() to remove a modal window, does it full clear the panel from the memory or just hide the panel? My application window displayed by using  InstallPopup() .

 

 

David

0 Kudos
Message 1 of 7
(4,086 Views)

RemovePopup () simply hides the panel; it remains avaialble for UI calls such as GetCtrlVal or DisplayPanel or so. To free all associated resources you must call DiscardPanel ().



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?
Message 2 of 7
(4,079 Views)

Sorry Roberto for having doubts on your answer... To my understanding (which may be wrong) Discardpanel is used only for regular panels, not for popup panels. For example, for Discardpanel you need to supply a panel handle, and I see no way to obtain a panel handle for a popup, simply because there is only one popup per thread possible at a time...

 

Am I mistaken?

 

Wolfgang

0 Kudos
Message 3 of 7
(4,051 Views)

I suppose you are confusing between CVI panels (loaded with LoadPanel and shown modal with InstallPopup) and system popups like for example MessagePopup: system popups are automatically discarded after you press Ok or Esc or whichever key is required. On the other hand, a CVI panel installed as a popup can either simply be discarded or hided with RemovePopup (in case you want to access it after removing but before it is discarded or you intend to show it again later).



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?
Message 4 of 7
(4,042 Views)

Wolfgang:

 

If you create your own popup panel using the UI editor (not by calling one of the prefab popups like MessagePopup() or ConfirmPopup(), etc.), then you use LoadPanel to load the popup and get the handle, InstallPopup (instead of DisplayPanel) to display it, and RemovePanel to hide it.  DiscardPanel clears the panel from memory.

 

Look at the attached program for a demo.  It has two popups that can be loaded (but not displayed) at the same time.  Both popups have a numeric control that you can set to show that the panel is still in memory after RemovePanel until you DiscardPanel.  See the instructions on the main panel to run the demo.

Message 5 of 7
(4,039 Views)

Al and Roberto, thanks! Indeed I was simply considering the built-in popup panels...

 

Wolfgang

0 Kudos
Message 6 of 7
(4,026 Views)

Thanks.

 

David

0 Kudos
Message 7 of 7
(4,019 Views)