MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulate[] eval hold until all controls are changed?

  • To: mathgroup at
  • Subject: [mg101708] Re: [mg101667] Manipulate[] eval hold until all controls are changed?
  • From: "David Park" <djmpark at>
  • Date: Wed, 15 Jul 2009 07:07:24 -0400 (EDT)
  • References: <10357881.1247564194896.JavaMail.root@n11>


Maybe someone can show how to adjust a Manipulate statement to do what you
want. But I find this a natural case of writing a custom dynamic. With a
custom dynamic you can easily control, through the second argument of
Dynamic, precisely what each control does and you can precisely control what
display items are dynamically updated. You also have much more control of
the layout of the entire display.

Here is a custom dynamic presentation along the lines you suggest. The
DensityPlot takes a longer time so it is only updated when the Run button is
pressed. The advisory message, however, is updated each time a parameter is

 {a = 1, b = 0, c = 0, current = True, f, plotf, plot},
 f[a_, b_, c_][x_, y_] := a Sin[x y] + b Cos[x] + c Cos[y];
 plotf[a_, b_, c_] := 
  DensityPlot[f[a, b, c][x, y], {x, 0, 4 \[Pi]}, {y, 0, 4 \[Pi]},
   ColorFunction -> ColorData["ThermometerColors"],
   MaxRecursion -> 4,
   ImageMargins -> 20,
   ImageSize -> 300];
 plot = plotf[a, b, c];
   (* PopUp and Run Controls *)
   Row[{Spacer[20], "a", Spacer[37], "b", Spacer[35], "c"}],
      Dynamic[a, (a = #; current = False) &], {0, 1, 2, 3, 4}],
      Dynamic[b, (b = #; current = False) &], {0, 1, 2, 3, 4}],
      Dynamic[c, (c = #; current = False) &], {0, 1, 2, 3, 4}],
     (* Update the plot *)
     Button["Run", plot = plotf[a, b, c]; current = True]
     }] (* Popups *),
   (* Indicator that the plot is current *)
    If[current, "Plot is current", Style["Plot is not current", Red]],
   (* The plot *)
   }](* Main Column *)

If you look into the PlaneGeometry section of your copy of Presentations you
will find a rather extensive tutorial on writing custom dynamic

David Park
djmpark at  

From: divisor [mailto:congruentialuminaire at] 

Hello MathGroup:

I have 3 drop-down list boxes to set parameters in my Manipulate[]
application. After the user changes any one of these, Manipulate
evaluates the first argument. It is a semi-long running application,
so it you want to change 3, the usability is compromised.

Is it possible to make Manipulate[] delay evaluation until all of
these boxes have their value set?

I assume I need some other control to tell Manipulate[] to "do it

Any assistance with this is greatly appreciated.


Roger Williams
Franklin Laboratory

  • Prev by Date: Re: Add syntax highlighting to own command
  • Next by Date: Re: CityData seems to be dead.
  • Previous by thread: Manipulate[] eval hold until all controls are changed?
  • Next by thread: Re: Manipulate[] eval hold until all controls are changed?