[squeak-dev] ProgressInitiationException>>defaultAction calls #isMorphic

David T. Lewis lewis at mail.msen.com
Thu Apr 14 19:49:49 UTC 2011


I'm not looking at an image right now, but what you are describing
sounds exactly right to me.

Dave

On Thu, Apr 14, 2011 at 07:18:41PM +0200, Bal?zs K?si wrote:
> Hi,
> 
> In the Trunk displayProgress:at:from:to:during: has two senders:
>  (1) MCHttpRepository >> displayProgress:during:
>  (2) String >> displayProgressAt:from:to:during
> 
> and has three identical implementations in MVCUIManager,
> MorphicUIManager, SimpleMorphicUIManager. The implementation:
> 
> displayProgress: titleString at: aPoint from: minVal to: maxVal
> during: workBlock
> 	"Display titleString as a caption over a progress bar while workBlock
> is evaluated."
> 	^ProgressInitiationException
> 		display: titleString
> 		at: aPoint
> 		from: minVal
> 		to: maxVal
> 		during: workBlock
> 
> don't even use the object where it resides.
> 
> With the exception of (1) everybody else (56 senders) uses (2) to
> display progress in the Trunk.
> 
> My take would be to change (1) to also use (2). Change (2) to:
> 
> String >> displayProgressAt: aPoint from: minVal to: maxVal during: workBlock
> 
> 	"Display titleString as a caption over a progress bar while workBlock
> is evaluated."
> 	^ProgressInitiationException
> 		display: self
> 		at: aPoint
> 		from: minVal
> 		to: maxVal
> 		during: workBlock
> 
> Change ProgressInitiationException's defaultAction to:
> 
> ProgressInitiationException >> defaultAction
> 
> 	UIManager default
> 		displayProgress: progressTitle
> 		at: aPoint
> 		from: minVal
> 		to: maxVal
> 		during: workBlock
> 
> And move the actual implementations of the displaying to the
> corresponding UIManager subclasses.
> 
> The drawback of this approach is that we possibly break code out there
> which uses UIManager's displayProgress:at:from:to:during:. So we could
> make up a new name like reallyDisplayProgress:at:from:to:during:, and
> send that from ProgressInitiationException >> defaultAction. It would
> be a bit less nice, but backward compatible. What do you think?
> 
> Bal?zs



More information about the Squeak-dev mailing list