How to unload Etoys from Squeak 5.3
Last updated at 3:48 pm UTC on 18 December 2021
Unloading Etoys from Squeak 5.3 currently does not work by choosing 'Unload' in the Monticello browser (August 2020, 1st attempt).
The steps below explain how to do it with a useful result (2nd attempt).
Further work is needed: Squeak 5.1 comes without Etoys and may be used as a reference.
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.
This means that in a recent trunk image from http://files.squeak.org/trunk/ does not need this step and unloading (point 2.2) works without freezing the image. However
the fixes in 2.4. and 2.5 still need to be done.
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'.
6. In a Workspace execute "Smalltalk garbageCollect"
There is still some clean-up needed:
there is a reference to an Etoys method called #newSqueakFlap on the class side of Flaps. Search for this method and apply the following fix in the code:
ScriptingSystem belonged to Etoys. It is now no longer present so the font information has to come from another place:
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 does not work and blocks the image with many debugging windows.
A "solution" is NOT to use the 'Widget' flap and remove the 'objects' entry in the 'World' menu.
The problem is that the method #partsDescriptionsFromToolsFlap is no longer present. The solution is either to go for the Squeak 5.1 version of this method and readd it or recategorize it before unloading Etoys.
The method #nonWrappingPrototype on the class side of TextMorph has also been removed in the unload proce3ss.
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).
Retest with Squeak 5.3 release image OK. December 2021.