Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
x = 0; Dynamic[{x, Button["+1", Pause[6]; x++]}, SynchronousUpdating -> False]

The documentation states that Dynamic and Manipulate will abort synchronous computations that take longer than 5 seconds. The stated solution to this is to set SynchronousUpdating to False. That does not seem to work here. If I pause for 5 or fewer seconds it always works, but if I pause for 6 or more seconds, x always stays at 0 no matter the setting for SynchronousUpdating.

share|improve this question
add comment

1 Answer

Eh, the answer lay a click deeper in the documentation. You need to set Method->"Queued" on Button, then you don't even need to disable SynchronousUpdating. This now works as expected.

x = 0; Dynamic[Button[x, Pause[6]; x++, Method -> "Queued"]]
share|improve this answer
    
+1 for self-answering and sharing the solution. –  Mr.Wizard Apr 11 '13 at 3:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.