RE: mouse click problem




i am facing  a problem in mouse click.  i am using iconview to
display some items to the user. I want the items to be activated at
single mouse click only. and even in case of double or triple mouse
clicks it should be fired only once.  Now here is the problem  How
should i ignore the multilple single clicks generated in the case of
double or triple clicks

Same way you spot double or tripple clicks in the first place.

You could drop a timestamp (preferably with sub-second resolution) on the item each time it gets clicked, and 
ignore any clicks if they were within some minimum timeout period.

Or, you could set a timer when you trigger the item, and ignore any further clicks until the timer expires.  
You could even re-start the timer on each click.


Alternatively, if it starts a long-running process (such as an image viewer), then disable the item until the 
process finishes (assuming you don't still need to be able to manipulate it).  An alternative to disabling 
the item, would be to make a note somewhere (such as in user-data on the item itself) that it's still active, 
and simply ignore attempts to activate it while that flag persists.


Take your axe, bobs your auntie, and all that jazz.

Fredderic

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]