Re: Manipulate question
- To: mathgroup at smc.vnet.net
- Subject: [mg94456] Re: Manipulate question
- From: "sjoerd.c.devries at gmail.com" <sjoerd.c.devries at gmail.com>
- Date: Sun, 14 Dec 2008 07:35:34 -0500 (EST)
- References: <ghqk3t$189$1@smc.vnet.net>
Mark, The problem with the solutions using TrackedSymbols is that the symbols that trigger the update have to be part of the thing that will be manipulated by the Manipulate construction. If they are not, they don't trigger an update. In your case, you only wanted a button that upon pressing cause the values of *other* variables to be updated. The button itself should not necessarily be connected to a variable that will be 'manipulated', i.e. will be part of the final display. The following code tricks Manipulate in doing this. As you asked for, there is a real "Continue" button, which causes the tracked symbol to change and an If statement containing a tautology involving this variable to effectuate the trigger. Try this without the If part and the symbol and you'll see the display of the variables isn't updated. I suppose there are more elegant ways to do this, but this is the best I could come up with at the moment. Cheers -- Sjoerd d = 1; Manipulate[ If[d == 1 || d != 1, {a, b, c} (* insert some useful action with your pop-up values here *)], {a, {1, 2, 3}, ControlType -> PopupMenu}, {b, {1, 2, 3}, ControlType -> PopupMenu}, {c, {1, 2, 3}, ControlType -> PopupMenu}, Delimiter, Button["Continue", d = -d], TrackedSymbols :> {d} ] On Dec 11, 10:47 am, "Coleman, Mark" <Mark.Cole... at LibertyMutual.com> wrote: > Greetings > > I'm working on a Manipulate-based interface that takes user input from > several drop down menus (in my application there are 9 of them) and then > runs a set of calculations based upon the user's choices. By default > Manipulate will run the calculation every time the user changes any of > the drop down menus. Ideally I'd like to have the interface not do any > computation until the user makes all of their selections and then > explicitly initiates the calculation (ideally using something like a > 'Calculate' button). Does anyone have an example of how this might work? > > Thanks, > > Mark