LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview slider event handling problems - revisited

I was also rather frustrated by this behavior, which seems counter-intuitive to me. I guess I understand why it's that way, but it's not the way it seems to me that a slider "should" work.  Warren's workaround is great, but I didn't like the way it queued a bunch of Value Changed events, which are dispatched after the mouse button is released, only to be discarded.  It made the UI seem a bit sluggish.

So I made the attached workaround.  Basically, it uses two shift registers to keep an eye on Mouse Down and Mouse Up events, and once the mouse is released, dispatches a Value Changed event. Value Changed events while the mouse button is down are ignored, others are processed normally.

This should work with any number of controls, with any datatype or a mixture of datatypes.  I didn't that last bit was going to work, until I realized that (CtrlRef)=(CtrlRef constant) is *not* the same as (CtrlRef constant)=(CtrlRef).  That seems totally wrong to me. 
Message 11 of 11
(1,048 Views)