How to unload Etoys from Squeak 5.3
Last updated at 2:33 am UTC on 29 January 2021
Unloading Etoys from Squeak 5.3 currently does not work directly by choosing 'Unload' in the Monticello browser (August 2020).
The steps below explain how to do it.
1st Attempt – does not work
Using the Monticello browser does not work
By following the description of How to unload Etoys from Squeak 5.2 it should be possible to unload Squeak in the Monticello Browser.
But the image freezes.
(MCPackage named: 'EToys') unload.
has the same effect.
2nd Attempt – good success
The steps described here are the result of the analysis done Analysis - What needs to be done to unload Etoys?
This has been tested in a pristine Squeak 5.3 image with all the latests updates: choose 'Squeak update' from the Squeak menu to get about 15 fixes done after the release.
Do the following reclassifications of some Etoys methods to the base image methods.
- Search for method in class Form>>isVirtualScreen and reclassify it from category '*Etoys-OLPC-Display' to 'testing'.
- reclassify the class method #curvePrototype in class PolygonMorph from category '*Etoys-Squeakland-instance creation' to '*MorphicExtras-instance creation'.
- Move methods #start and #stop which are in category '*Etoys-Squeakland-accessing' of class Interval to the 'accessing' category.
(note - the above changes have been applied to Squeak trunk as of 28-Jan-2021)
After the changes under point 2.1 have been done it is now possible to
unload Etoys with Monticello (the same steps as in How to unload Etoys from Squeak 5.2).
1. Open a Monticello browser,
2. Right click on Etoys package
3. select unload
4. Wait until the package is unloaded
5. In a SystemBrowser select class 'Morph' and click in the method categories pane: select 'remove empty categories'.
There is still some clean-up needed:
there is a reference to an Etoys method which needs to be fixed:
Flaps class newSqueakFlap.
ScriptingSystem belongs to Etoys which is now no longer present:
aButton label: 'save' translated font: (aFont := ScriptingSystem fontForTiles).
aButton label: 'save' translated font: (aFont := TextStyle defaultFont).
The method #addStackMenuItems:hand: in PasteUpMorph (subclass of Morph) calls a removed method named #isStackBackground in class Morph ( was category '*Etoys-card in a stack')
addStackMenuItems: menu hand: aHandMorph
"Add appropriate stack-related items to the given menu"
[menu add: 'card & stack...' target: self action: #presentCardAndStackMenu]
So delete method #addStackMenuItems:hand: in PasteUpMorph and when you are asked for the sender also delete the code line where it is called.
Delete the code printed in bold below:
addCustomMenuItems: menu hand: aHandMorph
"Add morph-specific menu itemns to the menu for the hand"
super addCustomMenuItems: menu hand: aHandMorph.
self addStackMenuItems: menu hand: aHandMorph.
self addPenMenuItems: menu hand: aHandMorph.
self addPlayfieldMenuItems: menu hand: aHandMorph].
2.5 - Result / Status
The result is a responsive image with which it is possible to work.
How to check the result
6. Bring up a halo menu on any Morph, click on viewer (eye) button.
7. This should open an Inspector instead of an Etoys Viewer OK
8. Bring up World menu and click on objects This is Not OK
9. This should open aPartsBin. Check if there are no DNU. There is a DNU (not an issue if you do not work with the parts bin).
In addition you need to test this with your code. It could be that your code calls Morphic methods which were in the Etoys package.
In the category '*Etoys-geometry' in the class Morph there are the getter / setter methods
In case your code uses them you need to add them again. For example by keeping them in a 'Etoys-Patches' package. Or go back to point 2.1 and reclassify them before unloading.
There might also be issues with objects in the Flaps, see example of PolygonMorph above (point 2.1).
2.6 - Outlook
Watch out for general results resulting from testing added on this page in the upcoming weeks. Or if you find out about an issue please post it here.