How Can I Control When Manipulate Refreshes or Re-evaluates?

Hello everyone,

I have a simple Manipulate that does just two things: (1) it performs a data analysis, which takes about 20 seconds, based on the my choice of a sample in a popup menu; and (2), because the output has multiple parts, it allows the me to display different parts by choosing from a tab menu. There is never a need to repeat the data analysis in (1) unless I choose a different sample, but unfortunately that is exactly what happens every time the I choose to look at a different part in (2). So, how to I get Mathematica to analyze the data only when I choose a new sample?

Gregory

Maybe something like this:

Manipulate[
 	If[choice != oldchoice,
  		oldchoice = choice;
  		sample = Partition[10 choice Range@6, 2];
  		Pause@3
  	];
 	sample[[part]],
 	{{choice, 1, "Sample choice"}, Range@10},
 	{{part, 1, "Part of sample"}, Range@3},
 	{sample, ControlType -> None},
 	{oldchoice, 2, ControlType -> None},
 	TrackedSymbols :> {choice, part}
 ]

Thanks for the suggestion, Hans,

I’ll have to study this!