05-29-2014 04:26 AM
Okay- really poor thread title admittedly as it's difficult to encapsulate the problem in that few words.
I have a big old complicated front panel control - arrays of clusters which themselves include arrays, etc. When a control is clicked on, I want to make a decision in software on how to respond and then update the control accordingly. I can do this with events but it's messy- the controls flicker before the software gets a chance to update them, so for example if the user clicks on an empty array space, the array will grow for a fraction of a second before I resize it back to the old size.
Is there any way around this?
Solved! Go to Solution.
05-29-2014 07:28 AM
Hard to say without seeing it myself.
But I suspect that you could use a filter event instead or a normal event to capture the click before LabVIEW actually responds to the click. Discard the click and do whatever you need from there. This could get a little complicated.
05-29-2014 08:24 AM
I wasn't aware of the ability to filter events- that leads in a useful direction. The only problem is this-
Using a 'value change' event I can find what item within the structure was clicked by comparing old and new values, and acting accordingly. With a 'mouse down?' I can't- all I can see to tell me what was clicked is the mouse co-ordinate, and it would be a serious pain to convert this to a 'what was clicked?' programatically.
I could do with something like a 'value change?' event- where I can pull up what the modified cluster value would be if the click was processed so I can easily search for the modified element.
Any more thoughts?
05-29-2014 09:54 AM
You can still keep track of the previous values in a shift register/feedback node to know what values changed. Or you can use the mouse coordinates to determine what array elements the mouse is over. There are examples on how to do this on NI's site. Here is one of them but I think there is a cleaner version somewhere.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-30-2014 05:03 AM
Thanks Hoovs- looks like working from mouse coords is the way forward.