Consider the following snippet of code:
Module[{pr, ps, var, option},
option = 1;
var = 0;
pr[] := Module[{}, var++; Print[var]];
ps[] := Print["Test..."];
PaneSelector[
{1 ->
Button["Defaults 1",
option = 2,
ImageSize -> 100],
2 ->
Button["Defaults 2",
option = 1;
pr[],
ImageSize -> 100]},
Dynamic[option]]
]
Note that pr[] is executed when the button "Defaults 2" is clicked.
Question: I want to execute a function immediately after a Pane is selected in a PaneSelector construction. How should this be implemented?
( Question translated to the context of the above snippet: how to execute either ps[] or pr[] immediately after setting option to 1 or 2?)