Further update to Rolodex tutorial
Karl Ramberg
karl.ramberg at chello.se
Mon Apr 23 16:58:04 UTC 2001
Ok now I actually got around to test the code I mailed :-)
Here is how to do it:
1 Change the name of the text morph containing the email adress to Email
2 Add a BasicButton to the Rolodex.
3 Open a viewer on the BasicButton
4 Add a new script to the button ( this is hard to describe to
beginners, there are no
good names or description for these widgets)
5 In the new script click the checkbox ( number three from top left in
the script) which toggles between
tile and textual representation of the code. We want textual.
6 Copy and paste this text into the text field. (Leave the bold line
saying: script1 but delete the line saying: ^self.)
| messageStrm |
messageStrm _ WriteStream on: (String new: 30).
messageStrm nextPutAll: 'From: ';
nextPutAll: Celeste userName;
cr;
nextPutAll: 'To: ';
nextPutAll: ((self costume owner
submorphNamed:'Email') text string );
cr;
nextPutAll: 'Subject: '.
CelesteComposition
openForCeleste: Celeste current
initialText: messageStrm contents
7 accesept that code (command key + s on mac).
8 test the button.
9 Bug me if it does not work :-)
Karl
More information about the Squeak-dev
mailing list
|