[squeak-dev] Instantiating a ToolBuilder for a UIManager (was: Re: The Inbox: ToolBuilder-Morphic-dtl.100.mcz)

David T. Lewis lewis at mail.msen.com
Sat Mar 21 19:04:36 UTC 2015


On Sat, Mar 21, 2015 at 12:21:09PM -0400, David T. Lewis wrote:
> On Fri, Mar 20, 2015 at 10:07:45AM -0700, Marcel Taeumel wrote:
> > Hmm... I just realized that the instance variable in the UIManager is always
> > nil in my images. Seems that the "new" initialization code was never
> > executed in a migration script.
> > 
> > Please make sure that the logic of #findDefault in ToolBuilder does not get
> > broken. There, you can create subclasses and use those as tool builders.
> > Using this fix, subclassing would not work anymore.
> >
> 
> I put another update in the inbox. The #findDefault logic is now used to
> find the ToolBuilder class to use, and this normally happens the first time
> that a ToolBuiilder is needed in a new Project. The mechanism should now
> work as before, but the UIManager no longer needs to have a dedicated
> ToolBuilder instance.
>

I should note for the record that I am the person who added the #toolBuilder
instance variable a few years ago. At the time, I did not notice the side
effect of garbage accumulating in the tool builder's registry. Hopefully
the changes in the inbox will make it right.

For background, here is where that original set of changes were made:

  Name: ToolBuilder-Kernel-dtl.46
  Author: dtl
  Time: 5 March 2011, 1:05:35.352 pm
  
  A Project has a UIManager, and a UIManager has a ToolBuilder, so add
  #toolBuilder ivar to UIManager and initialize accordingly. This
  facilitates setting up the appropriate UIManager and ToolBuilder to
  allow SMxMorphicProject to host a SimpleMorphic world.
  
  Change Toolbuilder class>>default to always ask the default UI
  manager for its tool builder. Remove class var Default (this was
  provided in the ToolBuilder package but never used in Squeak).
  Deprecate ToolBuilder class>>default:
  
  Background: In previous Squeak usage, ToolBuilder class>>default always
  invoked a search for the appropriate ToolBuilder subclass, and class var
  Default was unused (this is awkward if more than one kind of ToolBuilder
  could be used in a project that #isMorphic). This change makes the default
  tool builder an explicit attibute of the active UI manager.

Dave
 


More information about the Squeak-dev mailing list