I want to show a progress indicator while statements in a Module are processed.
Outside a Module this ca be done like this:
messages = {};
Column[{ Dynamic[zeilenZ]
, Pane[
ProgressIndicator[
Dynamic[zeilenZ]
, {0, Dynamic[length]}
]
] (* Pane *)
, Dynamic[TextGrid[messages]]
}
] (* a semicolon after the bracket would suppress the ProgressIndicator! *)
zeilenZ = 0; (* many computations following *)
However, if I put this sequence of statements into a Module expression, I get an error message Set::write: Tag Times in Null ... is Protected.
. If I put a semicolon after the closing bracket of Column
, the next line would no longer be understood as a multiplication of Column[....]
and what follows it, in my case zeilenZ
. But the ProgressIndicator would be suppressed too!
The same would happen, if I would plot something instead of Column
.
Of course, I could assign the whole Column statement (or Plot statement) to a variable, but how could I show it on the screen?
The only way out I have conceived so far is to assign the result of the Column
statement to a variable col
(which initially is assigned the empty list {}
) and display that with Dynamic[col]
before using the module. It looks like col
having to be a global variable for that purpose and my ProgressIndiator appears where the Dynamic[col]
is output.
Are there better ways to achieve my objective?