| Author |
Comment/Response |
Michael
|
01/13/13 9:51pm
In Response To 'Re: Re:' --------- Look at the option setting
Method -> "Queued"
(instead Method -> "Preemptive")
An alternative might be to set a flag and have the action check the flag to see if Mathematica was in the middle of evaluating another button click. Or you might use them together.
This one discards clicks until it's done with the action:
Button["hi",
If[actionFlag =!= "busy", actionFlag = "busy"; Pause[2]; Beep[];
actionFlag = "free"]]
This one queues clicks, so each click results in a beep after a wait.
Button["hi",
If[actionFlag =!= "busy", actionFlag = "busy"; Pause[2]; Beep[];
actionFlag = "free"], Method -> "Queued"]
URL: , |
|