[Q] Morph owners

Chris Muller afunkyobject at yahoo.com
Fri Sep 12 02:42:27 UTC 2003


> > It seems clunky to be overriding this private method anyway.  Is
> > there a better way?
> 
> Yes. Use #noteNewOwner: to do this.

That helped a lot, thanks.  Now part 2 of the question.  After I've dragged it
out and it now points to its former owner, I later want to click its "close"
halo to delete it.  I want to delete the line connecting it to its priorOwner.

Given the semantics of it, I thought that noteNewOwner: aMorph would deliver
nil for aMorph.  So my code looks something like this:

	super noteNewOwner: aMorph.
	aMorph
		ifNil: 
			[ priorOwners do: [ : each | each deleteLineToResult ].
			self initializePriorOwners ]
		ifNotNil: [ priorOwners do: [ : each | each createLineToResult ] ]

What I find, however, this method arrives before it has set its owner has been
nil'd out, so the ifNil: case never runs.

Perhaps there is another method that notes deletion?

Thanks again!
  Chris

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Squeak-dev mailing list