How do I start Etoys from Squeak?

209 Views Asked by At

In the Squeak System Browser, I see that there are many class categories related to Etoys:

Squeak System Browser

But how do I access Etoys from Squeak? How do I get something like the screenshot shown below?

Etoys

(Source of Etoys screenshot: https://commons.wikimedia.org/wiki/File:Squeak_screenshot.png)

3

There are 3 best solutions below

4
tukan On

I think there is easier way than Leandro is proposing.

Just run the Workspace from the menu where you type:

Project enterNewWithInitialBalloons

Select it with mouse and run it - Do it (alt+d). Application should start. I'm unfamiliar with the application. To me it looks similar to the picture you show.

Edit: how did I find it?

I searched through the source code. I have to agree that this is not straight forward.

First I tried to find anything that has to do with Etoys project/class. I tried to find anything that would indicate that you can start it.

This way I found Etoys-Experimental package with class EToysLauncher. The word launcher to me sounded like it could be launched. I looked at the class of the EToysLauncher where I found instance creating protocol where you can find these methods (remember we are still at the experimental package!):

  • #buildGallery
  • #buildPanel
  • #openGallery
  • #openPanel

If you go through these e.g. EToysLauncher openPanel you will get a message doesNotUnderstand: #latestProjectVersionsFromFileEntries. I then started to investigate the Walkback. I tried to check what is the issue here. I got this message because of the last line ^ Project latestProjectVersionsFromFileEntries: entries.

I went to the Project>>latestProjectVersionsFromFileEntries: to check what it is actually doing. In meantime I have inspected the values from the entries variable in the debugger. In the entries I could find an OrderedCollection but nothing what would satisfy #('*.pr' '*.pr.gz' '*.project') from the method. So I thought to myself, that perphaps the Project itself could satisfy it.

I went to the Project class and protocol Etoys-Squeakland-instance creation where I found two methods #enterNew and #enterNewWithInitialBalloons.

The #enterNew gives doesNotUnderstand: #newMorphicOn: so I skipped that one and tried the #enterNewWithInitialBalloons, which worked and since it is in the protocol Etoys-Squeakland-instance creation I came to the conclusion it has create Etoys-Squeakland new instance.

Edit: Show shared flaps?

Yes, you can activate the flaps also via Show shared flaps.

There is, however, quite a difference between running the Project enterNewWithInitialBalloons and Showing the shared flaps via Preferences.

If you start the Etoys via the Project enterNewWithInitialBalloons you will start completely new project (your currently opened windows will be hidden). To see your previous windows you need to either Porojects/Enter Project and switch to the HomeProject or you have to close the newly opened project via Projects/Close This Project.

The source that shows it is:

enterNewWithInitialBalloons
    | newP |
    newP := MorphicProject new.
    newP world addMorph: (DoCommandOnceMorph new extent: 1@1; actionBlock: [SugarNavigatorBar putUpInitialBalloonHelp]; yourself).

    newP enter.

This creates new MorphicProject and to this project it adds new Morph.

On the other hand, if you start it with Preferences/Show shared flaps the flaps will be just added to your current environment without creating a new project.

The source that shows it is: Preferences class >>sharedFlapsSettingChanged

sharedFlapsSettingChanged
    "The current value of the showSharedFlaps flag has changed; now react"

    self showSharedFlaps  "viz. the new setting"
        ifFalse:        
            [Flaps globalFlapTabsIfAny do:
                [:aFlapTab | Flaps removeFlapTab: aFlapTab keepInList: true]]

        ifTrue:
            [Smalltalk isMorphic ifTrue:
                [self currentWorld addGlobalFlaps]]

The self currentWorld addGlobalFlaps adds the flaps to the currentWorld. The PasteUpMorph>>addGlobalFlaps creates new PasteUpMorph and adds it.

You can also notice the difference also in the menu bar title Untitled vs. HomeProject.

0
codefrau On

There are also Squeak versions set up specifically for Etoys, e.g.:

https://squeak.js.org/etoys/#fullscreen

0
Christoph Thiede On

In recent versions of Squeak, you can choose open the Extras menu in the world main docking bar and tick "set etoys mode".