Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Another Monitor problem

0 views
Skip to first unread message

Hannes Kessler

unread,
Nov 8, 2009, 7:26:50 AM11/8/09
to
Hello,

is it possible to monitor the intermediate state of a calculation with
Monitor inside the action argument of a Button? The following Monitor
example without a Button works:

Monitor[Do[i, {i, 10^7}], Refresh[Pause[0.03]; i, UpdateInterval ->
0.01]]

However, when the calculation is started by a Button only the final
result is displayed, the intermediate state of the calculation is not
monitored:

Button["Run", Monitor[Do[i, {i, 10^7}], Refresh[Pause[0.03]; i,
UpdateInterval -> 0.01]]]

Best regards,
Hannes Kessler

Albert Retey

unread,
Nov 10, 2009, 6:09:54 AM11/10/09
to
Hannes Kessler schrieb:

I think it is as often the Method option which will make the Button do
what you want:

Button["Run",
Monitor[Do[i, {i, 10^7}],

Refresh[Pause[0.03]; i, UpdateInterval -> 0.01]],
Method -> "Queued"]

hth,

albert

0 new messages