I'm using Manipulate
together with CreateDialog
to run a ListPlot
whenever I click on a simulation button. That is, evaluation within Manipulate
only occurs when I want to. Specifically, I have the code
s = {None};
Button["Start",
f[aa_, oo_, pp_] := CreateDialog[Column[{
Manipulate[
frame = Refresh[ListPlot[RandomInteger[{1, 100}, a]],
Sequence @@ s],
Control[{{a, 1, "a"}, 0, 100000, 1, Appearance -> "Labeled"}],
Button["Simulate", s = {}; s = {None}]]
}], Modal -> True, WindowTitle -> "Simulation"];
f[Unevaluated@a, Unevaluated@o, Unevaluated@p]]
which after clicking 'Start', leads to the popup window
Changing the values a
does not automatically updates the plot, only when I click on Simulate
.
For higher values of the parameter (a=100000
, for example), plotting takes a bit longer and since I'm on a CreateDialog
environment, the only indicator of ongoing evaluation is the following (I'm using Windows 10)
I wonder if it's possible to implement a small "loading" animation or progress indicator in the popup window itself. For example, replace the plot by that while it's being evaluated and inactivate the 'Simulate' button.
I am aware of Monitor
and ProgressIndicator
, but I can't seem to make it work in the CreateDialog
environment. Any ideas?