[squeakland] Default project on launch of Etoys-to-Go

Bert Freudenberg bert at freudenbergs.de
Wed Aug 7 08:14:35 EDT 2013


On 2013-08-07, at 07:13, Mike Lee <curiouslee at gmail.com> wrote:

> Hi,
> 
> I have Etoys-to-Go 5.0 installed and initialized on a USB drive. There is also an Etoys folder present. What I would like to do is have a project from the Etoys folder open immediately when Etoys-to-Go is launched from this USB drive (bypassing the clouds, car and script, but leaving that Home screen accessible with the back arrow). 
> 
> It looks like this can be made to happen by editing the world script1, but I don't have a clue how to edit that code.

This should do it:

	...
	self setTextVersion.
	(Project named: 'MyProject') ifNil: [
		[Project fromUrl: 'MyProject.pr'] ifError: [].
	].
	...

(Explanation: The "ifNil:" test is needed to prevent opening MyProject again every time you navigate to the home project. The "ifError:" lets the opening proceed normally if MyProject.pr is not found)

To make the change permanent, you will need to save the Etoys image:
* start "clean" (no additional projects loaded yet)
* make the "script1" change
* press Cmd-Shift-W to open the full world menu, select "jump to project..." and go to the hidden "Unnamed1" top-level project
* press Cmd-Shift-W again and select "save and quit"

Note that this will load the home screen first, then your project. If you want to bypass the home screen completely, do this instead of the above:
* start "clean" (no additional projects loaded yet)
* press Cmd-Shift-W to open the full world menu, select "jump to project..." and go to the hidden "Unnamed1" top-level project
* insert a line near the bottom of the SugarLauncher>>startUp method, it should look like:
	...
	[Project fromUrl: 'MyProject.pr'] ifError: [].
	self welcome: ''
* press Cmd-Shift-W again and select "save and quit"

- Bert -




More information about the squeakland mailing list