How to stop pickPoint()?



How can I stop the pickPoint() operation, e.g. if the user clicks on another button before he finished picking a point as he's supposed to:

    on someButton pressed do (
 	p1 = pickPoint()	  -- wait for user to pick a point
    on anotherButton pressed do (
 	-- user pressed another button before he 
 	-- finished the last pick point operation, so:
 [b]	stop_Pick_Point()	   -- but how???[/b]
 	-- pick another point will not work while 
 	-- another pickPoint operation is in progress...
 	p2 = pickPoint()	 
Does anybody has a solution for this?



You can disable the second button and enable it as soon as the user gives the first point. For example youo create the ui like this

button b1 "First Point" 
button b2 "Second Point" enabled:false

Now when you handle the first point pick enable the second button like this.

on b1 pressed do 
   p1 = pickpoint()
   b2.enabled = true
on b2 pressed do
   p2 = pickpoint()   

Hope this helps


Thank you mobeen!
I tried to work around like you described it. But the result ist not satisfying because the user always has to click right inside the active viewport in order to stop the operation.
I think I’m trying the “on tool create” events instead…


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.