I make a progress indicator like this:
(* prepare global variables for dynamic progress bar ... *)
messages = {{"initial message"}}; (* during runtime will be appended to it *)
count = 0;
maxCount = 1; (* initial value>0. It will later be be set to the maximum which count shall actually reach *)
dynAnzeige = (* dynAnzeige is anpother global variable *)
Column[
{ Dynamic[count]
, Pane[
ProgressIndicator[
Dynamic[count]
, {0, Dynamic[maxCount]}
]
] (* Pane *)
, Dynamic[TextGrid[messages]] (* further will appended to the global variable messages *)
}
]; (* Column *)
...
(* use case ... *)
Dynamic[dynAnzeige] (* a semicolon here would suppress it! *)
(* read data from file and set maxCount to number of lines read... *)
For[count = 1, count <= maxCount, count++
(* process data ... *)
...
(* if worth reporting... *)
AppendTo[messages
, {"...report what has happened..."
];
]; (* For loop to process data *)
My actual processing steps happen in deeply nested Modules: the communication with Dynamic[dynAnzeige]
is done through the above mentioned global variables.
When Dynamic[dynAnzeige]
is processed before time consuming statements in an input cell, another numbered oputput cell is generated and it is updated during the evaluation of that cell. My notebook uses messages = {{"initial message"}};
together with Dynamic[dynAnzeige]
in several cells.
How can I programatically get rid of an output cell generated by Dynamic[dynAnzeige]
after my lengthy computation is finished?
How can I determine the number of that output cell to address it.
I want to equip several time consuming input cells each with their own progress bar. But they shall only be live while the cell which outputs them is running and they shall be programatically removed after the time consuming processing is finished in that cell. The output of Print statements which goes below that dynamic progress bar shall not be affected by removing the dynamic thing.
Currently I see several of them and they are all live in parallel - due to the nature of Dynamic. But I only want one progress bar just below the currently running input cell.
PrintTemporary
? $\endgroup$PrintTemporary[Dynamic[dynAnzeige]]
is closed. Would it be possible to let the progress bar stay in the notebook until another one is activated (then in its own place)? $\endgroup$DockedCells
? Or something likestatuscell = AttachCell[ProgressIndicator[Dynamic@dynAnzeige]]
? $\endgroup$