I am author who for many years has been deploying interactive artistic
content via Squeak images. I've been relying heavily on the save morph to
file / load morph from file process to preserve content and move it from
one image to another. I have quite a few classes of my own which are
either directly or indirectly subclasses of various morph classes. I have
some questions about the save/load morph process.
When a morph is loaded from file, this will inevitably involve creating
new morphs, which will almost certainly involve methods that could be
overridden by a user-created morph subclass. I'm wondering whether the
load morph from file process might have "requirements" -- or even just
assumptions -- about morph creation that could cause problems during morph
loading that are not apparent when a user-subclass morph is created
interactively (say by the "new morph" menu). If the answer is yes, are
these documented somewhere?
For instance: One of the things that has to happen when a morph is loaded
from file is that various instance variables have to have their value
restored. I might or might not have code in a new or initialize method
which gives those variables a value. I guess I've been assuming that the
load morph process will "supersede" my morph creation code in giving
loaded morph instance variables the right value. Now I'm thinking that
assumption may not be valid, and if I have (say) an initialize instance
method, that might get executed *after* load morph instance value
restoration happens. Comments please?
Related question: Is there an intent in the save/load morph to/from file
process to preserve submorph order? Or do I have to have my own code in my
subclasses to "guarantee" this? (I've been just assuming submorph order
will be preserved.)
Is there a way my code can "know" whether a morph is being created from
the load morph from file process, rather than interactively?
-Thanks, Jim