Project .pr file and objets connected with dependency

Blaine Buxton blainebuxton at hotmail.com
Sat Mar 18 23:56:38 UTC 2006


Depedency is not saved in projects because by default objects store their 
events in the EventManager object. Now, Morphs store their events in their 
own action map, so they keep their events when projects are stored.

You can inside of your own objects have your own action map. Simply store 
the actionMap into an instance variable inside of the class. and return its 
value in the #actionMap message. All it needs to return is an 
IdentityDictionary. Browse implementers of #actionMap for examples.

You could also override the serialization methods to serial out the action 
map in the EventManager object for your instance, but I would do the 
suggestion above since it's simpler and less code.

Hope this helps.
------------------------------------------------
Blaine Buxton, Mad Scientist In Training
http://www.blainebuxton.com

>From: Hilaire Fernandes <hilaire at ext.cri74.org>
>Reply-To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>To: Squeak Devel <squeak-dev at lists.squeakfoundation.org>
>Subject: Project .pr file and objets connected with dependency
>Date: Sat, 18 Mar 2006 15:05:50 +0100
>
>Hello,
>
>I do have strange behavior when I try to create project file containing
>instanciated objets of my own. I have a collection of objects
>communicating between them with the dependency system (using messages as
>#when:send:to: and #triggerEvent:)
>
>When I save such project, then load it in another image (containing the
>necessary classes) the objects appear to be correctly saved, however the
>dependency between the objects is broken.
>
>I don't know that much about .pr file, so I wonder if the problem can
>come from the objects being intereconnected with such dependency.
>Can it be that?
>
>Hilaire Fernandes
>

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement




More information about the Squeak-dev mailing list