deficiences in projects

Ned Konz ned at squeakland.org
Tue Jan 13 17:48:49 UTC 2004


On Monday 12 January 2004 5:58 pm, ye juan wrote:
>   I have created a project, in which I editted a
> BookMorph. Now in another project, I want to directly
> use this BookMorph again. How can I do this?

If you have the original project loaded, then you can get to it.

The easiest way is to use the halo menu and say "copy and print.../copy to 
paste buffer", then go to the other project, open the World menu, and say 
"new morph/from paste buffer". But this will give you a duplicate (via 
veryDeepCopy), so any changes to the original will not be made in the new 
one.

The BookMorph itself can only be owned by one World and one Project.

You could have it move itself between projects if you wanted by doing 
something like:

oldWorld _ (Project named: 'OldProject') world.
newWorld _ (Project named: 'NewProject') world.
book _ oldWorld submorphNamed: 'Book'.
newWorld when: #aboutToEnterWorld send: #addMorphFront: to: newWorld with: 
book.
oldWorld when: #aboutToEnterWorld send: #addMorphFront: to: oldWorld with: 
book.

And then when you got tired of it doing this, you could say:

newWorld removeActionsSatisfying: [ :action | (action arguments at: 1 
ifAbsent: []) isKindOf: BookMorph ] forEvent: #aboutToEnterWorld. 

oldWorld removeActionsSatisfying: [ :action | (action arguments at: 1 
ifAbsent: []) isKindOf: BookMorph ] forEvent: #aboutToEnterWorld. 



More information about the Squeak-dev mailing list