Detecting Mouse Click

I’m drawing a dynamic line as mouse moves and I need to detect a click on TCanvas. If I use TPad::WaitPrimitive(), I can detect double-click and keypresses but when the mouse mouve, the line changes its position and for some reason WaitPrimitive() ends and the execution continues. Any idea of how I can make it know the difference between the line moving and the clicks or any other way I can detect the click?

Thanks.

EDIT: Already got double-click checking the return value, but there is a way to check a single click?

I guess one of the following post might help :wink:

http://root.cern.ch/phpBB2/viewtopic.php?t=4470&highlight=mouse+click

http://root.cern.ch/phpBB2/viewtopic.php?t=3527&highlight=mouse+click

Bertrand.