Matthew Fulmer uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mtf.419.mcz==================== Summary ====================
Name: Collections-mtf.419
Author: mtf
Time: 21 December 2010, 10:11:25.702 pm
UUID: b7480421-9a49-974b-ba11-eabd6e4aa053
Ancestors: Collections-ar.418
delegate String >> displayProgressAt:from:to:during: thru UIManager so that it works in Tweak, MVC, and Morphic
=============== Diff against Collections-ar.418 ===============
Item was changed:
----- Method: String>>displayProgressAt:from:to:during: (in category 'displaying') -----
displayProgressAt: aPoint from: minVal to: maxVal during: workBlock
"Display this string as a caption over a progress bar while workBlock is evaluated.
EXAMPLE (Select next 6 lines and Do It)
'Now here''s some Real Progress'
displayProgressAt: Sensor cursorPoint
from: 0 to: 10
during: [:bar |
1 to: 10 do: [:x | bar value: x.
(Delay forMilliseconds: 500) wait]].
HOW IT WORKS (Try this in any other language :-)
Since your code (the last 2 lines in the above example) is in a block,
this method gets control to display its heading before, and clean up
the screen after, its execution.
The key, though, is that the block is supplied with an argument,
named 'bar' in the example, which will update the bar image every
it is sent the message value: x, where x is in the from:to: range.
"
+ ^ UIManager default
+ displayProgress: self
- ^ProgressInitiationException
- display: self
at: aPoint
from: minVal
to: maxVal
during: workBlock!