check if gui selection has changed

The callback of an ui element is called whenever the element has been modified. However this does not necessarily mean that the value of the element has changed. Here is an example where an action is only performed if the value has changed. The trick is to use a value...