ProgressIndicator?

Ned Konz ned at bike-nomad.com
Sat Mar 30 22:09:57 UTC 2002


On Saturday 30 March 2002 01:35 pm, Mayuresh Kathe wrote:

> How do I use the ProgressIndicator?

In 3.2 I see the ComplexProgressIndicator.

Browsing for class references, I see (among others) a number of refs in 
Project.

Looking at one of them, I see:

storeOnServerWithProgressInfo
	ComplexProgressIndicator new 
		targetMorph: nil;
		historyCategory: 'project storing';
		withProgressDo: [self storeOnServerInnards]
	

Apparently, a block is being executed.

OK, let's look at storeOnServerInnards.

Hmm... we see that it signals ProgressNotification signals periodically:

	ProgressNotification signal: '2:versionsDetected'.

OK, let's look at withProgressDo:. First, note that it only works in Morphic. 
If you don't mind that, then we see that it uses the note string in the 
exception to update its display.

So the answer (if you're using Morphic) is:
pass withProgressDo: a block that will signal ProgressNotifications.

If you're using MVC, look at String>>displayProgressAt:from:to:during: 
I found this by looking through the Project loading code, and eventually 
found PositionableStream>>fileInAnnouncing: which calls it (this is the 
familiar progress bar that pops up during change set loading).

'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]].

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com



More information about the Squeak-dev mailing list