Output from a Dynamic Module
- To: mathgroup at smc.vnet.net
- Subject: [mg97748] Output from a Dynamic Module
- From: Hugh Goyder <h.g.d.goyder at cranfield.ac.uk>
- Date: Fri, 20 Mar 2009 02:41:18 -0500 (EST)
In the toy example below I have a dynamic module where I adjust Locator points to form a curve. When I have got a nice set of points I would like to output them so that they can be used in other calculations. I have provided a button to do this but can't see the best way forward. Normally the output from a module is the last line but here this is not possible. I give a bad method by using a temporary file but what other methods are there? (And why does the temporary file I import get up-dated even when I don't press the button?) Thanks Hugh Goyder DynamicModule[{pts}, pts = {{0, 0}, {1, 0}, {2, 0}, {3, 0}}; Column[{ Button["Assign points", Export["temp", Dynamic[pts], "List"]], LocatorPane[Dynamic[pts], Dynamic[ Plot[Interpolation[pts][x], {x, 0, 3}, Frame -> True, Axes -> False, PlotRange -> {All, {-1, 1}}, ImageSize -> 7 72]] ] }] ] pp = Import["temp"]