PasteUpMorph question

Ned Konz ned at bike-nomad.com
Fri Nov 15 16:30:31 UTC 2002


On Friday 15 November 2002 07:33 am, Bergel Alexandre wrote:
> Hello, I would like to get notified by new morph are added to an
> instance of PasteUpMorph. Is there is smooth way to do it ? Right
> now, I plan to make a subclass of PasteUpMorph for puting some
> stuff at the end of acceptDroppingMorph:event:
>
> If anyone has a better solution, please let me know...

I did this with Connectors. It's my one change to base class methods.

Morph>>
addedOrRemovedSubmorph: aMorph
	aMorph fullBounds.
	aMorph changed.
	aMorph noteNewOwner: self.		"this line was added"

So this notifies morphs when they're dropped into something else.

As far as notification upon addition, you can subclass 
addedOrRemovedSubmorph: for the same purpose:

MyPasteUpMorph>>
addedOrRemovedSubmorph: aMorph
	super addedOrRemovedSubmorph: aMorph.
	aMorph owner == self ifTrue: [ "just added ..." ]


-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list