I am using Mathematica 11.3. I have been wrestling with the following issue for a while and suspect I have a conceptual difficulty as I can find nothing relevant on web searches so would appreciate any assistance appreciated.
In this example with the function test defined. I am trying to get the sum of n1 and n2 when the button is pressed. I have tried multiple manipulates, dynamic,evaluate, @, @@ but at best all that prints is
test[2,3]
where 2 and 3 would be the current slider values
What follows is sample code
test[a, b] := a + b;
Manipulate[
myPlot = Plot[Sin[n1 x] + Sin[n2 x], {x, 0, 2 Pi}, PlotRange -> 2],
{n1, 1, 20}, {n2, 1, 20},
Row[{Spacer[100], Button["Add n1 and n2",
Print[Evaluate[test[n1, n2]]], Method -> "Queued",
ImageSize -> 100]}]
]