Stopping a buttons actions

Richard Gaskin ambassador at fourthworld.com
Thu Feb 27 17:15:01 EST 2003


Tim Hart wrote:

> 
> On Thursday, February 27, 2003, at 04:47 PM, Richard Gaskin wrote:
> 
>> Ctrl-. (Win) or Cmd-. (Mac).
> 
> Thanks.  Now how do I do that with a button labeled "reset" so the user
> can do it to.

That's not so easy.  I did it once for WebMerge, and maybe there's a simpler
way but my method ate a lot of clock cycles.

I called a function in my repeat loop that checked the mouseLoc, and if it
was over the Cancel button it turned the cursor from watch to hand.  Then it
checked if the mouse was down, and if so it sent a "mouseUp" to that button.
With the overhead of event polling, this dragged my app's performance down
dramatically.

In a later version I simply removed the button and replaced it with a note
for the user to type Ctrl-. to cancel, and commented out the function call:
My app was now much faster, and not a single user has ever even noted the
change, other than to express their appreciation for the speed increase.

Anyone have an efficient way of implementing a Cancel button from within a
loop?

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list