Skip to main content

Timeline for Manipulate with explicit updates

Current License: CC BY-SA 3.0

14 events
when toggle format what by license comment
Oct 15, 2012 at 12:23 comment added Albert Retey @jVincent: honestly I don't think it is conceptually that much better: either way it's a "trick" to use a "hidden" variable (not a bad thing at all, but conceptually probably not straightforward either way). But it just seems shorter and if we need a variable there, why not making use of it? My actual concern was to emphazise that I think your solution has the advantage over the others that by using Method->"Queued" the OP can solve a problem that I could well imagine him to see in the near future. Actually the ButtonBar solution of kguler has the same property, even by default...
Oct 15, 2012 at 12:08 history edited jVincent CC BY-SA 3.0
deleted 40 characters in body
Oct 15, 2012 at 12:08 comment added jVincent @AlbertRetey Indeed, that does look better, and in a sense val does belong to those controls in that case, so it's conceptually better I think. I've updated my answer to reflect your improvement.
Oct 15, 2012 at 12:06 comment added Albert Retey @jVincent: one of the strongest advantages of using buttons as you do is that you could use Method->"Queued" for them which would make this work even when the evaluation of f or g would take long enough for an abort of the dynamic (which might be the case from what the OP mentioned in a comment). As novar is just a dummy variable, you could use val instead there and get rid of the DynamicModule: `Manipulate[val, {x, {1, 2, 3}, Setter}, {{val, "please click button...", "operator"}, Row[{Button["Call f", val = f[x]], Button["Call g", val = g[x]]}] &}]
Oct 15, 2012 at 11:12 history edited jVincent CC BY-SA 3.0
deleted 7 characters in body
Oct 15, 2012 at 11:12 comment added jVincent @MikeHoneychurch Indeed, Never though about the fact that novar is localized in Manipulate just like any other var. I suppose I didn't think it threw because I really wanted to not have a var at all.
Oct 15, 2012 at 11:02 comment added Mike Honeychurch no worries but novar in the DM is still redundant.
Oct 15, 2012 at 10:49 history edited jVincent CC BY-SA 3.0
added 7 characters in body
Oct 15, 2012 at 10:48 comment added jVincent @MikeHoneychurch Thanks, I actually thought it was DynamicModule, I copied the original code without noticing.
Oct 15, 2012 at 10:40 comment added Mike Honeychurch novar the Module variable is not the same as novar localized within Manipulate and is not needed. If you want val to be stored then it should be a DynamicModule.
Oct 15, 2012 at 10:18 comment added Ajasja +1 (although I would use DynamicModule instead of Module
Oct 15, 2012 at 10:11 vote accept Helium
Oct 15, 2012 at 9:44 vote accept Helium
Oct 15, 2012 at 10:10
Oct 15, 2012 at 8:58 history answered jVincent CC BY-SA 3.0