Below is code which is supposed to create a window with a graphic, and then refresh is every 3 seconds until the Control "run" is unchecked. It creates the window and does the continuous refresh, but unchecking "run" has no effect. Can any of you please point out what I'm doing wrong?
Thanks
run = True;
window = CreateDocument[Dynamic[graphic], WindowSize -> {600, 450},
TextAlignment -> Center, ShowCellBracket -> False,
WindowFrame -> "Frameless", WindowFrameElements -> {}];
Manipulate[
While[run,
points = Table[RandomReal[{-1, 1}, 2], 10];
graphic =
ListPlot[points, PlotRange -> {{-1, 1}, {-1, 1}}, PlotLabel -> run];
Pause[3];
];
NotebookClose[window];
Abort[],
{run, {True, False}}
]
run
NotebookClose[window]