Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a progress indicator in my Mathematica notebook that I update as various calculations are performed:

indicator = ProgressIndicator[Dynamic[progress]];

I would like to figure out how to remove the indicator when the calculations are complete or in the case above when

progress == 1

I’ve looked through the documentation and can’t seem to find a good way to do this.

share|improve this question
Does the second example in the Basic Examples section of Monitor in the docs look useful? – kglr Apr 17 '14 at 2:09
Good to know about Monitor but that didn’t help... – Pam Apr 17 '14 at 15:41
up vote 3 down vote accepted

Let's just not draw it if the progress goal is achieved:

 x = Clock[3];
 If[x < 1,

Sequence can be "" or whatever is appropriate in your application.

share|improve this answer
All the answers are good… I didn’t explain my situation fully. Hence I will chose the first answer. – Pam Apr 17 '14 at 15:42

It is quite unclear where that element is, so maybe this approach will fit you needs:

progress := Clock[1, 1, 1];

nb = CreatePalette[DynamicWrapper[
                     If[progress == 1, NotebookClose@nb], UpdateInterval -> 1]
share|improve this answer

Here's an inelegant way of getting rid of progress indicators at the end of a calculation, while leaving other results alone:

nb = EvaluationNotebook[]; (*The current notebook object.*)
SelectionMove[nb, Previous, GeneratedCell]; (*Select ALL cells just generated ...*)
sc = SelectedCells[]; (*... and get them.*)
MapIndexed[ (*Map over them, and...*)
  (nr = ToString[NotebookRead[#1]]; (*... get a String version.*)
  If[Not[StringFreeQ[nr, "ProgressIndicator"]],(*Does it have "ProgressIndicator"?*)
    NotebookDelete[sc[[#2[[1]]]]] (*If so, delete the cell.*)
  )&, sc];

SelectionMove[nb, After, Cell]; (*Finally, put the selection back where it belongs.*)

Better late than never! I hope this helps. Obviously, the code could also be invoked from 'progress' with an 'If' statement.

share|improve this answer

Let's try such code:

trig = True;

pi = Dynamic[If[trig, ProgressIndicator[0.5], ""]];


If trig is True, then ProgressIndicator is visible, otherwise it is not..

Playing with value of trig you can dynamically change the state of any visible elements.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.