10-05-2010 03:07 AM - edited 10-05-2010 03:10 AM
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
10-05-2010 04:38 AM
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 ().
10-05-2010 02:01 PM
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
10-05-2010 04:26 PM
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).
10-05-2010 04:50 PM
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.
10-06-2010 12:28 AM
Al and Roberto, thanks! Indeed I was simply considering the built-in popup panels...
Wolfgang
10-06-2010 02:44 AM - edited 10-06-2010 02:45 AM
Thanks.
David