# Manipulate inside a function definition

I am writing a notebook where I have to configure several curves (using locators in manipulates), to not repeat code I would like to write a function that wraps a manipulate and returning the manipulated value, that is doing something like:

a = MyManipFunc[];
Dynamic[a + 3]


Where The first line would display a manipulate and the second would dynamically update to reflect the value currently set. The best I have managed is (Reduced to bare minimals):

MyManipFunc[] := Module[{tt = 16},
Print[
Manipulate[
tt = t; t,
{t, 0, 10}]
];
tt
]


But does not do as I want since a is not updated despite including Dynamic. Any pointers would be appreciated!

-
Maybe I'm missing the point but tt is changing it's value while using Manipulator. Switch tt to Dynamic@tt at the end of the code to see that. –  Kuba Jul 3 at 20:38
Would the much simpler expression Column@{Manipulate[a = t, {t, 0, 10}], Dynamic[a + 3]} be what you are looking for? –  m_goldberg Jul 3 at 20:44
Is this what you finally want do to: MyPlotFunc[some code ... MyManipFunc[] ... some code], so you would obtain the dynamic value from inside your plot function? Intuitively, I would swap that, using MyManipFunc as a wrapper to any plot function and doing something like: MyManipFunc[MyPlotFunc, {dynamic vars}]. MyManipFunc will then pass the dynamic values as arguments to MyPlotFunc. That is also pretty straight-forward to realize. –  Theo Tiger Jul 4 at 14:21
Hi, thank you all for your comments, despite it not beeing precisely what I was looking for I can make it workshops by inverting the logic as suggested by Theo. –  Vskrap Jul 6 at 18:06