[squeak-dev] MorphicProject subclass: #EtoysProject

Bert Freudenberg bert at freudenbergs.de
Fri Oct 6 13:48:56 UTC 2017


On Fri, Oct 6, 2017 at 2:44 PM, David T. Lewis <lewis at mail.msen.com> wrote:

>
> So we might have some kind of rule in project loading that says "if
> the current project is an EtoysProject, and if I am loading a *.pr for
> a MorphicProject, then make it an EtoysProject". And perhaps when saving
> a project, we could reverse the rule and always save a project as
> MorphicProject, because we know that a loader in EtoysProject will know
> how to do the right thing with it.
>

​Actually, projects saved from the Squeakland image store a class named
"Project​". Since this has been made abstract now, we instead load it as
MorphicProject.

​The logic is mostly in SmartRefStream, in this case, #initKnownRenames.

It's all class-based. E.g. if the shape of a class changed (new / renamed
inst vars) that class can provide a "conversion method" that creates an
instance with the new layout from the old inst vars (that are loaded as a
dictionary). There still is a preference (conversionMethodsAtFileOut) that
used to prompt people to provide these conversion methods when they changed
a class. But it didn't survive the transition to Monticello, we now have to
remember to write conversion methods for instances that may be stored in a
project.

I can see now that I misunderstood one important thing. I was assuming that
> a new EtoysProject would open up with a playfield like the one I see when
> I first start a normal Etoys image. But I see now this is wrong, an Etoys
> project should initially have an empty playfield, but perhaps there is a
> one-time setup that happens the very first time that I enter a new
> EtoysProject
> from the world of "normal Squeak". So maybe if I enter a new EtoysProject
> from a MorphicProject or MVCProject, it will automatically load some
> initial project that sets up the welcoming playfield with a car driving
> around, but when I load or create new EtoysProjects from there, the new
> projects would just start with empty playfields.
>
> Am I guessing right?
>

The only difference in an Etoys project is the initial screen layout, yes.
Basically, the menu bar should be replaced with the navigator bar. In
theory this should just flip a couple of preferences. I'm not sure why a
special "EtoysProject" class would be useful.

This is different from the Etoys home screen (the clouds and drive-a-car)
which is simply a project that would be loaded by the deployment script
that creates an Etoys image. It does not have to ship with the general
Squeak image.

UI-wise I'd think in any kind of project there should just be a plain "new
project" menu item that would create the same kind of project
(MVC/Morphic/etc) as the current one. And only in addition to that would I
add items to create other kinds of projects.

- Bert -​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171006/eb5a5f56/attachment.html>


More information about the Squeak-dev mailing list