Button Timing Problem (I think)

Mark Schonewille m.schonewille at economy-x-talk.com
Fri Feb 29 13:01:54 EST 2008

Hi Len,

1) Unfortunately, yes. So, I try to avoid this entirely.

2) I am not sure what your script looks like. First of all, I'd say  
don't make a button respond to mouseDoubleUp if it may also respond to  
mouseUp. If you are running a mouseDoubleUp script and want to make  
sure that mouseUp doesn't run, you can use the flushEvents function at  
the end of the mouseDoubleUp handler.

I understand your button is on a dialog. So, what about this.

-- button "Okay"
local lHaveBeenClicked -- that's an L not an i

on mouseUp
   if lHaveBeenClicked is not true then
     put true into lHaveBeenClicked
     -- run script
   end if
end mouseUp

setprop hasBeenClicked theBool
   put theBool into lHaveBeenClicked
end hasBeenClicked

Now in the stack script of your dialog:

on closeStack
   set the hasBeenClicked of btn "Okay" to false
end closeStack

Something like this might work.

Best regards,

Mark Schonewille


Economy-x-Talk Consulting and Software Engineering

Convert colours between different colour spaces with Color Converter.  
Download at http://economy-x-talk.com/cc.html

On 29 feb 2008, at 18:41, Len Morgan wrote:

> 1) Does a double click send a mouseDoubleUp AND a mouseUp message  
> (for the first of the two clicks)?
> 2) Can I somehow disable the button fast enough to prevent a double  
> click?

More information about the Use-livecode mailing list