[ENH] NewProgressBar

Ken G. Brown kbrown at tnc.ab.ca
Fri Apr 9 00:27:02 UTC 2004


I'm trying to understand how the NewProgressBarMorph all works and it looks
to me that in the Postscript, the NewProgressBarMorph and NewProgressMorph
get renamed to get rid of the New in the names.

"Postscript:
This is just a hack to get a smooth filein even if an old version of this is
already in the system"
[
	| note |
	note _ ((StringMorph contents: 'Updating') color: Color red)
openInWorld.
	(Delay forSeconds: 2) wait.
	(Smalltalk includesKey: #ProgressMorph) ifTrue: [
		ProgressMorph removeFromSystem.
		ProgressBarMorph removeFromSystem].
	NewProgressMorph rename: #ProgressMorph.
	NewProgressBarMorph rename: #ProgressBarMorph.
	note delete.
] fork.!

and yet in the ProgressBarMorph nextSlotFor: after the filein, there is
still a reference to NewProgressBarMorph.
How can this work if there is no longer a NewProgressBarMorph in the system?

This occurs similarly in ProgressInitiationException 
defaultMorphicAction where a reference to NewProgressMorph remains.

How would you change the height of each progress bar? I see in the
ProgressMorph where the class variable BarHeight gets set to 16 in the
initialize method, but if I put a self halt there, it never gets hit.

How would you change it to display at the cursor? If I do something like

'Test' displayProgressAt: ActiveWorld activeHand cursorPoint
	from: 0 to: 1000
	during: [:bar | 1 to: 1000 do: [:i | bar value: i. (Delay
forMilliseconds: 6) wait]]

It still displays at the center of the screen.

Thx for any insight.

   Ken





More information about the Squeak-dev mailing list