From: Murray Eisenberg on 14 Dec 2008 07:41 I just found a peculiar behavior with such a panel: In the "Factor 1" field I type: 5. Next, I press Tab, expecting to move to the next input field; instead, the label "Factor 2" is highlighted! I Tab again so as to put the cursor into the second input field; as soon as I type into that field, the white field background (and border around the field) disappear, leaving my entry on the same shaded background as the panel. finally, I click the Calculate button; I get result 5 Null. David Park wrote: > Throw Manipulate in the ashcan and try something like this: > > Module[ > {fac1 = "", fac2 = "", product = ""}, > Panel[ > Column[ > {Row[{"Factor 1: ", InputField[Dynamic[fac1], String]}], > Row[{"Factor 2: ", InputField[Dynamic[fac2], String]}], > Dynamic(a)Row[{"Product: ", product}], > Row[ > {Button["Clear", fac1 = ""; fac2 = ""; product = ""], > Button["Calculate", > product = ToExpression[fac1] ToExpression[ fac2]]}] > }](* Main Column *), > Style["Enter and Calculate Form"] > ](* Panel *) > ] > > > David Park > djmpark(a)comcast.net > http://home.comcast.net/~djmpark/ > > > From: Coleman, Mark [mailto:Mark.Coleman(a)LibertyMutual.com] > > > 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 > > > > -- Murray Eisenberg murray(a)math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
From: John Fultz on 16 Dec 2008 02:35 On Thu, 11 Dec 2008 03:47:48 -0500 (EST), Coleman, Mark 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 As documented on the Manipulate function home page... "With the setting ContinuousAction->None, an explicit Update button is displayed, and expr is not re-evaluated until this is pressed." It looks like this is precisely what you're looking for. Sincerely, John Fultz jfultz(a)wolfram.com User Interface Group Wolfram Research, Inc.
First
|
Prev
|
Pages: 1 2 Prev: Problem with MathLink using Mathematica 7.0 Next: Sample uniformly from a simplex |