LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Managing multiple panels created in code

Good Day:

I'm trying to manage multiple panels within a project - The main panel sets up the config of a test and based upon user inputs there are multiple tests run (1.....n) where "n" is unknown beforehand.  The code I've written opens up a new panel containing a graph for each test condition, the panel and the graph are generated within the code.

Now for the question: each panel has the normal windows "minimize, maximize, close" icons @ the top right.  The minimize and maximize work properly but the close button does nothing.  I expect there is a panel attribute I need to set to enable closing and discarding a panel when the user clicks on the red "X", but I've not been able to figure out this setting.

Any help would be appreciated, Thanks

-Ed


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

Hi Ed,

You need to have a panel callback installed, and then handle the EVENT_CLOSE event. That event is sent when the user operates the X button. It is then up to you to decide what to do in your code at that point.

There is another alternative that you can use, if you also have a "Quit" button in that panel. You can associate the behavior of the panel's X button with the behavior of the Quit button by setting the ATTR_CLOSE_CTRL attribute on the panel. When you do that, an event is also sent to that button's callback whenever the user operates the X button, so that you don't need to have a panel callback.

Luis

0 Kudos
Message 2 of 4
(3,173 Views)
Luis:

Thanks for the quick reply, the answer always seems obvious when someone takes the time to point it out 🙂

-Ed


0 Kudos
Message 3 of 4
(3,152 Views)
This is a little late, but if anyone else come's across this thread, I just wanted to point out that there is a KnowledgeBase article that explains this as well that is related to this:
KnowledgeBase 16NC6D52: Closing a LabWindows/CVI Application by Selecting the "X" Button in the Titl...
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 4 of 4
(3,148 Views)