Etoys Tips and Tricks: Difference between revisions
(^ TipsAndTricks initialize) |
No edit summary |
||
Line 15: | Line 15: | ||
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: |
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: |
||
<pre> |
|||
self beAllFont: (StrikeFont familyName: 'BitStreamVeraSans' size: 24) |
self beAllFont: (StrikeFont familyName: 'BitStreamVeraSans' size: 24) |
||
</pre> |
|||
Or whatever font you want it to be of course. |
Or whatever font you want it to be of course. |
||
Line 24: | Line 26: | ||
To obtain keyboard focus on the textbox of your choice, you can use the following function: |
To obtain keyboard focus on the textbox of your choice, you can use the following function: |
||
<pre> |
|||
obtainKeyboardFocus |
obtainKeyboardFocus |
||
ActiveHand keyboardFocus: self costume renderedMorph. |
ActiveHand keyboardFocus: self costume renderedMorph. |
||
self costume renderedMorph editor selectAll |
self costume renderedMorph editor selectAll |
||
</pre> |
|||
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. |
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. |
Revision as of 08:46, 10 March 2008
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!!