Skipping pending events

Hi all,

Consider we have the following situation :
- A labelTextChanged(..) callback, triggered by the change of label contents
- A buttonClicked(..) callback, triggered by the button's click.

The user, changes the contents of the label and, clicks the button directly.
At this point two events are fired : 
a) labelTextChanged(...), and after that,
b) buttonCliked(...).

We supose that the contents of the label are incorrect, so, we will show an error message and we want to leave the screen at the current state.
But, when the labelTextChanged(...) function has been finished, the pending event  buttonCliked(...), starts to run.

In this case, is there a way to skip/clear/ignore the pending events ?

Thanks in advance







If you launch a modal dialog when the label text is changed in a way that becomes invalid, then how could someone click the button?

The user-action that forces the post-label trigger to be fired is exactly the user-click on the button.
In other words, the user, when finishes the typing in the label,   does not press the tab- or any other forward key to exit from the label, but just clicks on the button. 

Sorry, I don't quite see the problem.. (But I would suggest that trying to skip events is never a good solution for anything!)

Normally if you have multiple things that you'd like to trigger a single event, you might use an AsyncUpdater or Timer that gets started when any of the events happen, and that'll take care of coalescing them.

Actually, what I want to do is to keep the focus into the entry-field being wrong, regardless of the user's action that makes the entry-field lost the focus.