Etoys Tips and Tricks

From OLPC
Revision as of 05:10, 10 March 2008 by Ties (talk | contribs) (^ TipsAndTricks initialize)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Just a few tips and tricks to overcome a few common hurdles your average Etoys beginner (that would be me) might run into.


Oneliners

when image hangs: alt-.

recover from hang on smalltalk level: world-leftclick > changes > recently logged changes. Select all the relevant changes and file them in.


Text input box hacks

the Etoys input box is a bit flaky and basic at the moment. One of the OLE Nepal guys is working on a general fix, but for now we can tweak it with a few hacks:

Textboxes change size, depending on whether there is text in there or not. We can fix this by opening an inspector on an instance and execute:

self beAllFont: (StrikeFont familyName: 'BitStreamVeraSans' size: 24)

Or whatever font you want it to be of course.


To let the box respond with a function on a carriage return, define an etoys script (or squeak function) with, say, name #myOwnFunction, open an inspector on the appropriate instance and execute: self crAction:(MessageSend receiver: self player selector: #myOwnFunction)

To obtain keyboard focus on the textbox of your choice, you can use the following function: obtainKeyboardFocus ActiveHand keyboardFocus: self costume renderedMorph. self costume renderedMorph editor selectAll

The last line perhaps doesn't give you what you want, cause it selects the whole text every time focus is lost and regained again, but you can always take it away of course.


Installing Monticello on your Etoys image

At the moment you hit upon a bug when you want to install Monticello in an Etoys image through Squeakmap.

There's a way around this though. As from http://ircbrowse.com/channel/squeak/20070927 :

go to the monticello-hack-files dir in etoys-migration-files and first load the MonticelloBackport.8.cs file into your image.

Then load the Monticello-kph-434.st file. Here you will hit upon an error. Push 'debug' and find MCWorkingCopy Initialize in the stack trace. Return 'nil' from it. Then open a workspace or something and execute 'MCWorkingCopy registerForNotifications'. This should provide you with a working Montecello. Upgrade Montecello if you feel like it.

There might be another way around this bug, which we have yet to try. There's a compatibility layer called 'level playing field' (levelPlayingField/LPF.st) which tries to smoothen out the differences between different image forks. Might work. Or we could fix the bug of course!!