[squeak-dev] Squeak5.2 save morph / load morph from file
hannes.hirzel at gmail.com
Mon Jan 14 09:45:24 UTC 2019
Dave's suggestion to update a copy of the 5.1image to the latest trunk
version and then do the export is worth trying in any case. If that
works out fine then that is an easy and elegant solution.
If that does not work out another strategy I used successfully in the past is:
1. Create a new Morph object called 'lightBook' with property
#isSlideCollection oder #isPagesCollection. The extent should be
slightly larger than your original BookMorph so that you can easily
2. go through all pages of your bookmorph.
3. For each BookMorph page do
3a. Create a new Morph object with property #isSlide or #isPage
3b. Go through all submorphs of the BookMorph page and add them to the
morph from 3a
(Use addMorphBack: to preserve the order)
3c. Add the newly created light object (#isSlide) to the object
'lightBook' (again use addMorphBack:)
4. Save the object created under point 1.
5. Load the save morph in the target image and rebuild the bookMorph
with the material in a similar way
One of the reasons for this approach is that a BookMorph uses
PasteUpMorph objects as pages. They may be complex and attract a lot
of code material to be save out which is not easy to know about. This
may cause problems.
This said I did a similar exercise (Moving DATA objects represented by
Morphs) from an 2018 image (5.2a) which I want to archive to a new
2019 image (5.2). I encountered a problem with recomputing the cached
values for TextMorph (fix upcoming in the inbox). Also some morphs
(pages) had problems because of the content involved the import
procedure asked for code which was not in the target image and it was
not easy to get the correct version. So I skipped these very pages, to
avoid going for an in-depth analysis.
On 1/13/19, David T. Lewis <lewis at mail.msen.com> wrote:
> It may be easier to just update the 5.1 image to the latest trunk version,
> then save the morph after updating.
> Be sure to save a copy of your image and changes files first, then
> do the update as follows (it takes about 15 minutes or so):
> Go to Tools -> Preferences on the top menu bar to open a preference
> In the preference browser, scroll down to "updates"
> Change Update URL from http://source.squeak.org/squeak51 to
> http://source.squeak.org/trunk (accept change)
> Close the preference browser
> Squeaky mouse -> Update Squeak (upper left corner on the menu bar)
> This will start the update process. You will encounter several merge
> dialog boxes, just accept all the merges and proceed in each of them
> until done:
> Merging Morphic-mt.1297, accept two changes, merge.
> Merging ST80-mt.217, accept change, merge.
> Merging ReleaseBuilder-mt.169, accept change, merge.
> Merging Morphic-tpr.1321, accept three changes, merge.
> ReleaseBuilder-eem.172, accept change, merge.
> ==> done.
> On Sun, Jan 13, 2019 at 08:48:44PM +0100, karl ramberg wrote:
>> There was some work done to the SmartRefenceStream loading and saving in
>> It was broken i 5.1 so I'm not quite sure how much you must do to make it
>> I think it would be possible to back port the fixes if you can lokate
>> On Sun, Jan 13, 2019 at 6:43 PM Philip Bernhart
>> <philip.bernhart at posteo.de>
>> > Hi David,
>> > I tried to do an export / import again in the original
>> > squeak5.1-16549-64bit-201608171728 derived image.
>> > And it failed there too. Creating empty morphs and
>> > saving them / reloading them also fails when restoring
>> > them. Doing the same on a squeak5.2 image seems to be
>> > no problem.
>> > That's bad. As it makes it impossible? for me to migrate
>> > objects created in an image to upgrade them to a new squeak
>> > version (exporting them / reloading them).
>> > Suggestions?
>> > Thanks,
>> > Philip
>> > "David T. Lewis" <lewis at mail.msen.com> writes:
>> > > I can confirm the error, but I also see the same error when I try
>> > > to load the morph file in a freshly downloaded Squeak5.1-16553-64bit
>> > > image.
>> > >
>> > > Are you able to load the morph file back into the same image from
>> > > which it was generated?
>> > >
>> > > If so, perhaps there is something that has been changed or added
>> > > to that image that would need to be added to the new squeak 5.2
>> > > image as well. This is only a guess, but maybe it will help.
More information about the Squeak-dev