A modest proposal for a new property

Jim Lambert jiml at netrin.com
Wed Sep 27 15:02:33 EDT 2017


> Herman wrote:
> 
> Make a circular arc showing 70% of a pie and then tell us when clicking
> into the oval which part is hit, the 70% or the transparent 30%.
> 
> A one-liner?


Here’s a kludge. But it’s no one liner.

It takes a few milliseconds depending on size of the graphic.

on mouseUp pButtonNumber
   put inMe(the target, the clickloc)
end mouseUp

function inMe targ, where
   lock screen
   import snapshot from targ
   set the loc of the last image to the loc of targ
   put within(the last image, where) into returnValue
   delete the last image
   return returnValue
end inMe

Put the mouseUp handler in the graphic script.
The function can go in the graphic, group, card or stack script.

Jim Lambert



More information about the use-livecode mailing list