AW: [ENH] NewProgressBar

Alexander Lazarevic Alexander at Lazarevic.de
Fri Apr 9 11:19:29 UTC 2004


Hi Ken!

The problem that I was trying to address with this postscript was that
if you had an older version of ProgressMorph in the system a simple
fileIn would fail because during this fileIn one instance of
ProgressMorph was in use. Now instead of doing two things at the same
time (removing old ProgressMorph and installing my implementation
afterwards) I'm not touching the old ProgressMorph any more and just
renamed my thingy as SystemProgressMorph. This just avoids all this and
the problems you mentioned. The new name should also emphasize the
special character of this morph.

The intialize method in class SystemProgressMorphs gets run once when
you fileIn the changeset. You can change the values in the method and do
a systemProgressMorph initialize after that.

I'm not a big fan of having progress displays poping up at the cursor
location all over the screen, so I just ignore this information and
always place the progress morph at the center of the squeak window.
Instead of doing that you could also always move it to the cursor
location. Look at the method label:min:max: in SystemProgressMorph and
change it accordingly.

Alex

-----Ursprüngliche Nachricht-----
Von: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] Im Auftrag von
Ken G. Brown
Gesendet: Freitag, 9. April 2004 02:27
An: 'The general-purpose Squeak developers list'
Betreff: RE: [ENH] NewProgressBar


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