04-09-2009 08:42 AM
I want to trigger the panel close? event by using certain boolean control so is it possible to do that?
Thanks,
04-09-2009 08:47 AM
You will need to dynamically register an event.
Refer to the labview\examples\general\dynamicevents.llb for examples
04-09-2009 09:58 AM
That's not quite the same thing. Registering for an event isn't the same as triggering an event, which is what the user is trying to do. You can dynamically register/unregister events, but this basically allows you to change what an event structure listens to. It still has to receive the event. The Panel Close? event is an event that gets fired when the user clicks the "close" box in the window's title bar or if the user closes the window. Unfortunately, the FrontPanel.Close method doesn't trigger this event (WHY?), so I think** the only way to do this is to use the OS. For example, on Windows you can use the PostQuiteMessage. Too bad that this doesn't work with LabVIEW. So, I think** that you have to use the equivalent keyboard command to close a window.
Attached is an example in 8.2 that does this, using a SendKey llb that I found someplace (can't remember where).
** Meaning I may be wrong on this being the only way.
04-09-2009 12:27 PM