LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The close control on title bar of my panel no longer closes my program.

The 'x' on the title bar stopped working one day and I now notice other programs written by other engineers that behave the same way. What can we do to fix it? We are using Labwindows 6.0 running a debuggable executable on Win 2K platform.
0 Kudos
Message 1 of 4
(3,362 Views)
A "Close Control" is supposed to be defined for the panel in the UIR file (it must not be set to "None"), otherwisethe 'x' on the title bar doesn't work.

Hope this helps,

Phil. J.
Message 2 of 4
(3,362 Views)
Hello,
When you generate all code from the UIR file (menu Code->Generate All Code), you'll see that you can specify the program temination control in your uir file. When you specify a control here, your program generates the callback function that also gets called when you press the 'x' and terminates the program.

Mika Fukuchi
Applications Engineer
National Instruments
Message 3 of 4
(3,362 Views)
You need two things for the title bar X on a CVI panel to work:
1. The main panel must have a Close Control assigned.
2. The callback for the Close Control must call QuitUserInterface().
The title bar X on CVI's main panel doesn't do anything without those two things.
You can't select a control as a Close Control until you've assigned that control a Callback Function name.
If you use the Quit control (right-click on your panel, then goto Custom Controls, then select Quit), it already has a callback function name QuitCallback assigned. If you use a standard command button, you have to assign a Callback Function to it.
You select a Close Control when editing your main panel. Double-click on a blank spot on your panel and look at the selections available under Clo
se Control: all controls on your panel which have a Callback Function assigned are listed here.
As mentioned by Mika, you can generate the code for the Close Control when you Generate All Code. If you add a Close Control after you Generate All Code, you just need to generate the callback for that control and add a call to QuitUserInterface().
CVI 6.0 does not show an option to ignore the title bar X. If the X isn't working, it's probably because the Close Control hasn't been properly selected or the callback function for the Close Control doesn't call QuitUserInterface().
Message 4 of 4
(3,362 Views)