Camillo wrote:
the main problem with the current progress bar morph design is that updates are forced whenever the underlying model (here job) changes. This is *very* costly for high-frequency updates, which is exactly the moment when you want to use the progress bar ;)
It should work the other way around, the progress bar morph polls the underlying model with a given frequency (~10/s) and then refreshes the UI if the model changed.
I'm not in favor of polling. Most models are not thread-safe. The progress bar knows how much precision it has (1% or so) and so knows at which boundaries it needs to refresh. In addition the progress bar should show that something is happening a few times a second. For the first, it would be enough to only call self changed in ProgressBarMorph>value: when the result would be visible, i.e. when the completedWidth changes. ProgressBarMorph>value: aNumber |testWidth| value := aNumber. testWidth := self completedWidth. testWidth ~= cachedWidth ifTrue: [ cachedWidth := testWidth. self changed] and setting the cachedWidth to 0 on initialize. Hmm, where should I commit the 3.0 slice? Getting an error. Stephan