Very stange behaviour of Manipulate. Revaluating expression twice when once is expected.
- To: mathgroup at smc.vnet.net
- Subject: [mg118929] Very stange behaviour of Manipulate. Revaluating expression twice when once is expected.
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Mon, 16 May 2011 03:35:16 -0400 (EDT)
Version 8.0.01, on Windows. May be an expert here can explain, in simple terms, why they think Manipulate acts this way, because I can't figure it out and it seems not logical to me. I have Manipulate with one control variable. When I change the control variable by using the little open windows and type something in there, and hit return, then Manipulate will reevaluate the expression ONCE, as is expected. But when I do the same update, but now using the little '+' button in the open dialog (using Appearance->"Open") now Manipulate will evaluate the same expression TWICE ! In this example below, the expression just prints a random number. To allow one to more easily see the update happening twice, I put a PAUSE statement in the expression. But this can be removed if needed. Here is the code: ------------------------- Manipulate[ ( Pause[0.5]; If[True,ListPlot[{0,1}]]; Text[Random[]] ), {{t,1,"t"},.1,2,.1,Appearance->"Open"}, TrackedSymbols->{t} ] ------------------------- If you run the above, you'll notice Manipulate updates expression 2 times if you use '+', but will update one time when you type new value for 't' in the little window and hit RETURN. This behavior only shows up with I have that ListPlot[] command in there. If I remove the ListPlot[], then Manipulate no longer update the expression twice, but only once as expected. I know the ListPlot[] there is doing nothing, but the above is just an example to illustrate the problem, from a larger code. Any one knows, why Manipulate behaves different like this? I always thought changing the control variable using '+' or '-' or by keyboard are equivalent things and Manipulate should behave the same exact way ! Thanks --Nasser