Hi Carlos â
It depends â code added to objects using the ObjectEditor stays indeed with
the objects. So objects that are only embedded in world B will have no
effect on world A. However, there are two-and-a-half ways to sharing:
1. PartsBin: Publish your objects in the PB and load them anywhere. This is
a "pull" model, meaning that parts embedded in a world will not be
automatically updated, you either have to do that manually or via a script.
2. You can copy'n paste objects over. Give a morph keyboard focus by
clicking on it or draw a selection around one or multiple objects and press
CMD-c. In another world click in the background to give the world object
keyboard focus and press CMD-v.
3. Code in modules are loaded by all worlds that implicitly require or
actively load those modules.
First: How do you create a module? Press CMD-b, this will open a System
browser. Open a context menu in the top left pane and choose "add new
file". Your own users directory is a good place to store those modules.
Second: Loading them: To actively load a module inside a world you can open
a context menu on it in the System browser and choose "add to world
requirements". To manually load a module from source code evaluate sth
like: module('users.CarlosCrosetti.test').load() (to load the file
users/CarlosCrosetti/test.js). Auto load: When you define objects or
classes in your module and store instances of those in your world they will
automatically "remember" where they were defined and load their module when
the world loads.
As you see, the system is quite flexible but also complicated. I think we
will attempt to bring modules and parts together in the future.
Best,
Robert
Post by Carlos CrosettiHi,
I assume as I am able to save a world A under a different name, B, , code
added to B is not back ported to A automatically.
So if the above assumption, then worlds exhibited in the projects page do
not share the same code, in the same way Smalltalk images may be different
by the means of all objects inside.
Am I wrong?
Thanks, Carlos
_______________________________________________
lively-kernel mailing list
http://email.kra.hn/c/eJxljr0KgzAAhJ9GNyWaYsyQQSoWbOtSpHWMJtFo_MGk9ufpK9KlFI7jPo6DYwQJDJgtyT5KL3FbnOu3l3Q6FgBleIDtI3_qni_p8WAsGKenpWbXHBXYu5VVVls70FOp3HrzauzthlDMAMQi8EVIRQioT8ugErhipecjBKCtSGPMZMHI8pNVSmqj3WaS7n2QzjQazWjvMv6t5CDGLS5cvZyOzwNX9kx-eL3xv_8AWydJDw