Wednesday, August 5, 2009

Updating the User Interface

Have you ever had trouble updating a chart when using a slider to control the axis?

I have tried using event cases that run on:
  • value change - updates but in a clunky manner
  • mouse up - you don't always mouse up over the slide after dragging it
  • drag end - does not update on the fly, so there is no feedback
The solution I have started using requires an event driven producer consumer. It was suggested to me by one of the LabVIEW architects at my company (CPE Systems)

The trick here is to enqueue the update case only if it is not already in the queue. If the case already exists in the queue nothing is added to the queue. When the consumer handles the case it takes the latest value from the slide itself. Providing smooth, live updates. This trick also works for other complicated user interface redraws.

Have you got any neat tricks you use to enhance the look or feel of your software?

Followers